1
lzhe
2024-09-26 7d59e8e2c727dd49d9552a8febc2af47c5b95a69
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);
            }
        }
    }
};