export default (app) => { // 按钮权限/show-btn app.directive("permission", { beforeMount(el, binding) { const btnList = uni.getStorageSync("ruleBtn") ? uni.getStorageSync("ruleBtn") : []; if ( (binding.value && btnList.length > 0 && !btnList.includes(binding.value)) || btnList.length == 0 ) { // 解决进入页面按钮会闪一下再消失问题 el.style.display = "none"; setTimeout(() => { el.parentNode.removeChild(el); }, 0); } }, }); };