auth-btn.js 348 B

12345678910111213
  1. import { useAppStore } from '~src/store'
  2. const store = useAppStore()
  3. //自定义权限指令
  4. export const vAuthBtn = {
  5. mounted(el, { value }) {
  6. if (value && value.length > 0 && value[0]) {
  7. if (el.parentNode && !store.getButtonsVal(value[0])) {
  8. el.parentNode.removeChild(el)
  9. }
  10. }
  11. },
  12. }