Skip to content

Commit be2b584

Browse files
author
pixel
committed
修复指令绑定时效问题 修复Image组件未注册问题
1 parent f39048f commit be2b584

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

web/src/directive/auth.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// 权限按钮展示指令
22
import { store } from '@/store/index'
3-
const userInfo = store.getters['user/userInfo']
43
export const auth = (Vue) => {
54
Vue.directive('auth', {
65
// 当被绑定的元素插入到 DOM 中时……
76
bind: function (el, binding) {
7+
const userInfo = store.getters['user/userInfo']
88
let type = ""
99
switch (Object.prototype.toString.call(binding.value)) {
1010
case "[object Array]":
@@ -27,7 +27,6 @@ export const auth = (Vue) => {
2727
return
2828
}
2929
const waitUse = binding.value.toString().split(",")
30-
3130
let flag = waitUse.some(item=>item==userInfo.authorityId)
3231
if (binding.modifiers.not) {
3332
flag = !flag

web/src/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ import {
5252
Steps,
5353
Upload,
5454
Progress,
55-
MessageBox
55+
MessageBox,
56+
Image
5657
} from 'element-ui';
5758

5859
Vue.use(Button);
@@ -103,6 +104,7 @@ Vue.use(Upload);
103104
Vue.use(Progress);
104105
Vue.use(Scrollbar);
105106
Vue.use(Loading.directive);
107+
Vue.use(Image)
106108

107109
Vue.prototype.$loading = Loading.service;
108110
Vue.prototype.$message = Message;

0 commit comments

Comments
 (0)