21 lines
538 B
TypeScript
21 lines
538 B
TypeScript
import { useAdminInfo } from '/@/stores/adminInfo'
|
|
|
|
const authorityStore = useAdminInfo()
|
|
|
|
export const permission = () => {
|
|
return {
|
|
mounted: (el: any, binding: { value: number[] }) => {
|
|
let hasShow = false
|
|
for (let item of binding.value) {
|
|
if (authorityStore.authorities.includes(item)) {
|
|
hasShow = true
|
|
break
|
|
}
|
|
}
|
|
if (!hasShow) {
|
|
el.style.display = 'none'
|
|
}
|
|
}
|
|
}
|
|
|
|
} |