mirror of
https://github.com/iczer/vue-antd-admin
synced 2025-04-23 09:50:18 +08:00
fix: problem that it's not effective of authority in button; ⭐
修复:按钮中的权限不起作用的问题;
This commit is contained in:
parent
34e20a2110
commit
b8a9b57818
@ -88,7 +88,7 @@ const checkInject = function (el, binding,vnode) {
|
|||||||
|
|
||||||
const addDisabled = function (el) {
|
const addDisabled = function (el) {
|
||||||
if (el.tagName === 'BUTTON') {
|
if (el.tagName === 'BUTTON') {
|
||||||
el.setAttribute('disabled', 'disabled')
|
el.disabled = true
|
||||||
} else {
|
} else {
|
||||||
el.classList.add('disabled')
|
el.classList.add('disabled')
|
||||||
}
|
}
|
||||||
@ -96,8 +96,8 @@ const addDisabled = function (el) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const removeDisabled = function (el) {
|
const removeDisabled = function (el) {
|
||||||
|
el.disabled = false
|
||||||
el.classList.remove('disabled')
|
el.classList.remove('disabled')
|
||||||
el.removeAttribute('disabled')
|
|
||||||
el.removeAttribute('title')
|
el.removeAttribute('title')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,10 +105,10 @@ const AuthorityPlugin = {
|
|||||||
install(Vue) {
|
install(Vue) {
|
||||||
Vue.directive('auth', {
|
Vue.directive('auth', {
|
||||||
bind(el, binding,vnode) {
|
bind(el, binding,vnode) {
|
||||||
checkInject(el, binding, vnode)
|
setTimeout(() => checkInject(el, binding, vnode), 10)
|
||||||
},
|
},
|
||||||
update(el, binding,vnode) {
|
componentUpdated(el, binding,vnode) {
|
||||||
checkInject(el, binding, vnode)
|
setTimeout(() => checkInject(el, binding, vnode), 10)
|
||||||
},
|
},
|
||||||
unbind(el) {
|
unbind(el) {
|
||||||
removeDisabled(el)
|
removeDisabled(el)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user