mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-06 04:00:06 +08:00
fix: the problem that v-auth directive doesn't take effect in native html element; 🐛
修复:v-auth 指令在原生 HTML 元素上不生效的 bug;
This commit is contained in:
parent
c05efdee7a
commit
3e665bb7a9
@ -48,6 +48,7 @@ const auth = function(authConfig, permission, role, permissions, roles) {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
const preventClick = function (event) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
return false
|
||||
}
|
||||
@ -55,7 +56,7 @@ const preventClick = function (event) {
|
||||
const checkInject = function (el, binding,vnode) {
|
||||
const type = binding.arg
|
||||
const check = binding.value
|
||||
const instance = vnode.componentInstance
|
||||
const instance = vnode.context
|
||||
const $auth = instance.$auth
|
||||
if (!$auth || !$auth(check, type)) {
|
||||
el.classList.add('disabled')
|
||||
|
@ -28,5 +28,5 @@
|
||||
}
|
||||
.disabled{
|
||||
cursor: not-allowed;
|
||||
opacity: 0.4;
|
||||
color: @disabled-color;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user