提交 d0c576fa 编写于 作者: Mr.奇淼('s avatar Mr.奇淼(

修复指令绑定时效问题 修复Image组件未注册问题

上级 2cce33af
// 权限按钮展示指令 // 权限按钮展示指令
import { store } from '@/store/index' import { store } from '@/store/index'
const userInfo = store.getters['user/userInfo']
export const auth = (Vue) => { export const auth = (Vue) => {
Vue.directive('auth', { Vue.directive('auth', {
// 当被绑定的元素插入到 DOM 中时…… // 当被绑定的元素插入到 DOM 中时……
bind: function (el, binding) { bind: function (el, binding) {
const userInfo = store.getters['user/userInfo']
let type = "" let type = ""
switch (Object.prototype.toString.call(binding.value)) { switch (Object.prototype.toString.call(binding.value)) {
case "[object Array]": case "[object Array]":
...@@ -27,7 +27,6 @@ export const auth = (Vue) => { ...@@ -27,7 +27,6 @@ export const auth = (Vue) => {
return return
} }
const waitUse = binding.value.toString().split(",") const waitUse = binding.value.toString().split(",")
let flag = waitUse.some(item=>item==userInfo.authorityId) let flag = waitUse.some(item=>item==userInfo.authorityId)
if (binding.modifiers.not) { if (binding.modifiers.not) {
flag = !flag flag = !flag
......
...@@ -52,7 +52,8 @@ import { ...@@ -52,7 +52,8 @@ import {
Steps, Steps,
Upload, Upload,
Progress, Progress,
MessageBox MessageBox,
Image
} from 'element-ui'; } from 'element-ui';
Vue.use(Button); Vue.use(Button);
...@@ -103,6 +104,7 @@ Vue.use(Upload); ...@@ -103,6 +104,7 @@ Vue.use(Upload);
Vue.use(Progress); Vue.use(Progress);
Vue.use(Scrollbar); Vue.use(Scrollbar);
Vue.use(Loading.directive); Vue.use(Loading.directive);
Vue.use(Image)
Vue.prototype.$loading = Loading.service; Vue.prototype.$loading = Loading.service;
Vue.prototype.$message = Message; Vue.prototype.$message = Message;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册