Merge branch 'master' of gitee.com:youlaiorg/vue3-element-admin

Former-commit-id: 2cb0e4f6e930c06dd91d13ce753f5bcae200287a
This commit is contained in:
haoxr
2022-12-09 01:43:34 +08:00
2 changed files with 16 additions and 0 deletions

View File

@@ -1 +1,2 @@
export { hasPerm, hasRole } from './permission';
export { deBounce } from './utils';

View File

@@ -0,0 +1,15 @@
import { Directive, DirectiveBinding } from 'vue';
/**
* 按钮防抖
*/
export const deBounce:Directive = {
mounted(el:HTMLElement) {
el.addEventListener('click', e => {
el.classList.add('is-disabled')
setTimeout(() => {
el.classList.remove('is-disabled')
}, 2000)
})
}
}