fix: the problem that v-auth directive doesn't take effect in native html element; 🐛
修复:v-auth 指令在原生 HTML 元素上不生效的 bug;
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user