gaoshp
2024-11-03 dcc4992bd51e9ee4a97099cd3a15085f7e247f23
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);
            }
        }
    }
};