1
lzhe
2024-04-10 3ca71791b839d7c9731643a8653c0b6fe1c6233a
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);
            }
        }
    }
};