From 3e665bb7a937c5e3d3669671ba01991d28d44835 Mon Sep 17 00:00:00 2001 From: iczer <1126263215@qq.com> Date: Tue, 4 Aug 2020 19:45:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20the=20problem=20that=20v-auth=20directiv?= =?UTF-8?q?e=20doesn't=20take=20effect=20in=20native=20html=20element;=20:?= =?UTF-8?q?bug:=20=E4=BF=AE=E5=A4=8D=EF=BC=9Av-auth=20=E6=8C=87=E4=BB=A4?= =?UTF-8?q?=E5=9C=A8=E5=8E=9F=E7=94=9F=20HTML=20=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E4=B8=8A=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=20bug=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/authority-plugin.js | 3 ++- src/theme/default/style.less | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/authority-plugin.js b/src/plugins/authority-plugin.js index 64fe185..860b1d5 100644 --- a/src/plugins/authority-plugin.js +++ b/src/plugins/authority-plugin.js @@ -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') diff --git a/src/theme/default/style.less b/src/theme/default/style.less index 3c05a8c..c722172 100644 --- a/src/theme/default/style.less +++ b/src/theme/default/style.less @@ -28,5 +28,5 @@ } .disabled{ cursor: not-allowed; - opacity: 0.4; + color: @disabled-color; }