mirror of
https://github.com/jekip/naive-ui-admin.git
synced 2026-03-01 00:23:11 +08:00
fix Bug Features CHANGELOG.ms
This commit is contained in:
@@ -2,18 +2,18 @@ import { ObjectDirective } from 'vue'
|
||||
import { usePermission } from "@/hooks/web/usePermission";
|
||||
|
||||
export const permission: ObjectDirective = {
|
||||
mounted(el: HTMLButtonElement, binding, vnode) {
|
||||
if (binding.value == undefined) return
|
||||
const { action, effect } = binding.value
|
||||
const { hasPermission } = usePermission()
|
||||
if (!hasPermission(action)) {
|
||||
if (effect == 'disabled') {
|
||||
el.disabled = true
|
||||
el.style["disabled"] = 'disabled'
|
||||
el.classList.add("n-button--disabled")
|
||||
} else {
|
||||
el.remove()
|
||||
}
|
||||
mounted(el: HTMLButtonElement, binding, vnode) {
|
||||
if (binding.value == undefined) return
|
||||
const { action, effect } = binding.value
|
||||
const { hasPermission } = usePermission()
|
||||
if (!hasPermission(action)) {
|
||||
if (effect == 'disabled') {
|
||||
el.disabled = true
|
||||
el.style["disabled"] = 'disabled'
|
||||
el.classList.add("n-button--disabled")
|
||||
} else {
|
||||
el.remove()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user