wang-hao-jie
2022-08-25 2b506494d7c73a3978004bd0b32a5d0783b25efa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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;