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; }