Kaynağa Gözat

增加$CloseThisPage全局方法

piexlmax 3 yıl önce
ebeveyn
işleme
2f8a3e35d5

+ 2 - 4
web/src/core/gin-vue-admin.js

@@ -3,12 +3,10 @@
 *
 * */
 // 加载网站配置文件夹
-import config from './config'
+import { register } from './global'
 
 export const run = function(app) {
-  app.config.globalProperties.$GIN_VUE_ADMIN = config
-  // app.use(uploader)
-
+  register(app)
   console.log(`
      欢迎使用 Gin-Vue-Admin
      当前版本:V2.4.5 alpha

+ 11 - 0
web/src/core/global.js

@@ -0,0 +1,11 @@
+import config from './config'
+import { emitter } from '@/utils/bus.js'
+
+const closeThisPage = () => {
+  emitter.emit('closeThisPage')
+}
+
+export const register = (app) => {
+  app.config.globalProperties.$GIN_VUE_ADMIN = config
+  app.config.globalProperties.$CloseThisPage = closeThisPage
+}

+ 0 - 1
web/src/view/layout/aside/historyComponent/history.vue

@@ -252,7 +252,6 @@ export default {
       })
     },
     removeTab(tab) {
-      console.log(tab)
       const index = this.historys.findIndex(
         item => getFmtString(item) === tab
       )