gaoshp
2024-04-05 a4174a7f44dbae2ee3012b0991eba2f08a01ff9a
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);
            }
        }
    }
};