更新0.1.1版本

This commit is contained in:
Ah jung
2021-07-07 10:26:14 +08:00
parent b74b6e61a4
commit d423f27e94
174 changed files with 15966 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
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()
}
}
}
}