fix: the problem that v-auth directive doesn't take effect in native html element; 🐛

修复:v-auth 指令在原生 HTML 元素上不生效的 bug;
This commit is contained in:
iczer
2020-08-04 19:43:48 +08:00
parent f32fa56ba7
commit 64589950e5
3 changed files with 23 additions and 4 deletions

View File

@@ -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')