Browse Source

修复自定义指令修改为vue3模式

蒋吉兆 3 years ago
parent
commit
0b3dcbce1d
2 changed files with 1 additions and 2 deletions
  1. 1 1
      web/src/directive/auth.js
  2. 0 1
      web/src/utils/asyncRouter.js

+ 1 - 1
web/src/directive/auth.js

@@ -3,7 +3,7 @@ import { store } from '@/store'
 export const auth = (app) => {
   app.directive('auth', {
     // 当被绑定的元素插入到 DOM 中时……
-    bind: function(el, binding) {
+    mounted: function(el, binding) {
       const userInfo = store.getters['user/userInfo']
       let type = ''
       switch (Object.prototype.toString.call(binding.value)) {

+ 0 - 1
web/src/utils/asyncRouter.js

@@ -4,7 +4,6 @@ export const asyncRouterHandle = (asyncRouter) => {
   asyncRouter.map(item => {
     if (item.component) {
       item.component = dynamicImport(modules, item.component)
-      console.log(item.component)
     } else {
       delete item['component']
     }