vue自定义指令

Vue.directive(“hasMenu”, {
inserted: function(el, binding) {
// console.log(binding,“binding”);
// console.log(el.parentNode,“parentNode”);
let buttonperms = sessionStorage.getItem(“authMenus”);
// 首次加载有可能没有数据,如果没有需要使用延迟处理
if (
buttonperms &&
buttonperms != “undefined” &&
typeof buttonperms !== “undefined”
) {
if (Vue.prototype.KaTeX parse error: Expected '}', got '&' at position 67: …ntNode != null &̲& typeof el.par…_has(binding.value) == false) {
if (el.parentNode != null && typeof el.parentNode !== “undefined”) {
el.parentNode.removeChild(el);
}
}
}, 500);
}
}
});


版权声明:本文为wyystyle原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。