Browse Source

修改弹窗内容

callm 6 months ago
parent
commit
74f37f9041
2 changed files with 23 additions and 0 deletions
  1. 17 0
      src/assets/js/msgBox.js
  2. 6 0
      src/main.js

+ 17 - 0
src/assets/js/msgBox.js

@@ -0,0 +1,17 @@
+import MsgBox from '_c/MsgBox.vue'
+let ConfirmConstructor, instance
+
+const showMsgBox = {
+    install(Vue) {
+        ConfirmConstructor = Vue.extend(MsgBox)
+        instance = new ConfirmConstructor().$mount()
+        document.body.appendChild(instance.$el)
+
+        Vue.prototype.$showMsgBox = options => {
+            Object.assign(instance, options)
+            instance.init()
+        }
+
+    }
+}
+export default showMsgBox

+ 6 - 0
src/main.js

@@ -5,6 +5,7 @@ import store from './store';
 import dataV from '@jiaminghi/data-view';
 // 引入全局css
 import './assets/scss/style.scss';
+import ShowMsgBox from './assets/js/msgBox';
 import 'element-ui/lib/theme-chalk/index.css';
 // 按需引入vue-awesome图标
 import Icon from 'vue-awesome/components/Icon';
@@ -19,6 +20,7 @@ import echarts from 'echarts'
 import ElementUI from 'element-ui';
 
 import Cookies from 'js-cookie'
+import focusable from 'vue-tv-focusable';
 
 //5.x 引用方式为按需引用
 //希望使用5.x版本的话,需要在package.json中更新版本号,并切换引用方式
@@ -31,6 +33,8 @@ Vue.prototype.$cookie = Cookies;
 Vue.component('icon', Icon);
 Vue.use(dataV);
 Vue.use(ElementUI);
+Vue.use(ShowMsgBox);
+Vue.use(focusable);
 
 router.beforeEach((to, from, next) => {
   /**
@@ -81,6 +85,8 @@ Vue.prototype.$http.interceptors.request.use(config => {
   return config;
 });
 
+
+Vue.prototype.isFullScreen = false;
 // response interceptor 响应拦截
 //token,一般是在登录完成之后,将用户的token通过localStorage或者cookie存在本地,
 // 然后用户每次在进入页面的时候(即在main.js中),会首先从本地存储中读取token,如果token存在说明用户已经登陆过,