Skip to content

Commit

Permalink
修复指令绑定时效问题 修复Image组件未注册问题
Browse files Browse the repository at this point in the history
  • Loading branch information
pixel committed Apr 10, 2021
1 parent 2cce33a commit d0c576f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions web/src/directive/auth.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 权限按钮展示指令
import { store } from '@/store/index'
const userInfo = store.getters['user/userInfo']
export const auth = (Vue) => {
Vue.directive('auth', {
// 当被绑定的元素插入到 DOM 中时……
bind: function (el, binding) {
const userInfo = store.getters['user/userInfo']
let type = ""
switch (Object.prototype.toString.call(binding.value)) {
case "[object Array]":
Expand All @@ -27,7 +27,6 @@ export const auth = (Vue) => {
return
}
const waitUse = binding.value.toString().split(",")

let flag = waitUse.some(item=>item==userInfo.authorityId)
if (binding.modifiers.not) {
flag = !flag
Expand Down
4 changes: 3 additions & 1 deletion web/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ import {
Steps,
Upload,
Progress,
MessageBox
MessageBox,
Image
} from 'element-ui';

Vue.use(Button);
Expand Down Expand Up @@ -103,6 +104,7 @@ Vue.use(Upload);
Vue.use(Progress);
Vue.use(Scrollbar);
Vue.use(Loading.directive);
Vue.use(Image)

Vue.prototype.$loading = Loading.service;
Vue.prototype.$message = Message;
Expand Down

0 comments on commit d0c576f

Please sign in to comment.