完善数组判断处理

This commit is contained in:
龙运模
2024-08-27 21:30:59 +08:00
parent 9ca2c0e905
commit 78121f6093
12 changed files with 96 additions and 56 deletions
+19
View File
@@ -0,0 +1,19 @@
import { permissionAll } from '@/utils/permission'
import tool from '@/utils/tool';
/**
* 用户权限指令
* @directive 单个权限验证(v-auth="xxx")
*/
export default {
mounted (el, binding) {
if(permissionAll()){
return
}
let permissions = tool.data.get("PERMISSIONS");
// if(permissions.auth.some((v)=> v === binding.value)){
// console.log(binding.value,800)
// }
if (!permissions.auth.some((v) => v === binding.value)) el.parentNode.removeChild(el);
}
}