mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-19 01:15:53 +08:00
15 lines
401 B
JavaScript
15 lines
401 B
JavaScript
const hasPermission = {
|
|
install (Vue, options) {
|
|
Vue.directive('has', {
|
|
inserted (el, binding, vnode) {
|
|
let permTypes = vnode.context.$route.meta.permTypes;
|
|
if (permTypes&&!permTypes.includes(binding.value)) {
|
|
el.parentNode.removeChild(el);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
export default hasPermission;
|