gaoshp
2024-06-03 6f1ac1da6b6cba5c74f2fb6be82f7e472c4116ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { rolePermission } from '@/utils/permission'
 
export default {
    mounted(el, binding) {
        const { value } = binding
        if(Array.isArray(value)){
            let ishas = false;
            value.forEach(item => {
                if(rolePermission(item)){
                    ishas = true;
                }
            })
            if (!ishas){
                el.parentNode.removeChild(el)
            }
        }else{
            if(!rolePermission(value)){
                el.parentNode.removeChild(el);
            }
        }
    }
};