Yizhan-app/common/buttonPermission.js

13 lines
276 B
JavaScript

export default {
inserted(el, binding) {
const arr = ['test'] //['al_01','al_02']
const btnValue = binding.value
const btnIf = arr.includes(btnValue)
if (!btnIf) {
el.style.display = 'none'
setTimeout(() => {
el.parentNode.removeChild(el)
}, 0);
}
}
}