Browse Source

防止重复点击

master_hella_20240701
wangyufei 5 months ago
parent
commit
a00d7f4151
  1. 18
      src/components/XButton/src/ButtonBase.vue

18
src/components/XButton/src/ButtonBase.vue

@ -73,18 +73,18 @@ const emit = defineEmits(['buttonBaseClick', 'updataTableColumns'])
let timer = ref(null)
const buttonBaseClick = (val, item, $event) => {
if(!timer.value){
timer.value = setTimeout(()=>{
if(timer.value){
console.log('清空timer',timer.value)
clearTimeout(timer.value)
timer.value = null
}
},2000)
// if(!timer.value){
// timer.value = setTimeout(()=>{
// if(timer.value){
// console.log('timer',timer.value)
// clearTimeout(timer.value)
// timer.value = null
// }
// },2000)
clearButtonBlurHandle($event) //el-button
emit('buttonBaseClick', val, item, $event)
}
// }
}
onUnmounted(() => {

Loading…
Cancel
Save