评估优化
This commit is contained in:
17
ruoyi-ui/src/utils/plugins.js
Normal file
17
ruoyi-ui/src/utils/plugins.js
Normal file
@ -0,0 +1,17 @@
|
||||
import Vue from 'vue'
|
||||
|
||||
// 防止重复提交指令
|
||||
const preventReClick = Vue.directive('preventReClick', {
|
||||
inserted (el, binding) {
|
||||
el.addEventListener('click', () => {
|
||||
if (!el.disabled) {
|
||||
el.disabled = true
|
||||
setTimeout(() => {
|
||||
el.disabled = false
|
||||
}, binding.value || 3000)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
export { preventReClick }
|
Reference in New Issue
Block a user