| | |
| | | import Vue from 'vue' |
| | | import { buttonPinia } from '@/pinia/index' |
| | | |
| | | Vue.directive('permission', { |
| | | inserted: (el, binding) => { |
| | | const { value } = binding |
| | | const pinia = buttonPinia() |
| | | const piniaBtns = pinia.$state.buttonInfo |
| | | if (value && !piniaBtns.includes(value)) { |
| | | el.parentNode.removeChild(el) |
| | | } |
| | | } |
| | | }) |
| | | import Vue from 'vue'
|
| | | import { buttonPinia } from '@/pinia/index'
|
| | |
|
| | | Vue.directive('permission', {
|
| | | inserted: (el, binding) => {
|
| | | const { value } = binding
|
| | | if (!value) return
|
| | |
|
| | | const pinia = buttonPinia()
|
| | | const piniaBtns = pinia.$state.buttonInfo
|
| | | if (piniaBtns.includes(value)) {
|
| | | value === 'insert' && (el.className += ' search_btn')
|
| | | value === 'update' && (el.className += ' table_btn')
|
| | | value === 'delete' && (el.className += ' delete_btn')
|
| | | value === 'export' && (el.className += ' search_btn')
|
| | | } else {
|
| | | el.parentNode.removeChild(el)
|
| | | }
|
| | | }
|
| | | })
|