Browse Source

操作按钮防止重复点击

master_hella_20240701
yufei0306 6 months ago
parent
commit
7fec5a2177
  1. 9
      src/components/XButton/src/ButtonBase.vue

9
src/components/XButton/src/ButtonBase.vue

@ -72,8 +72,17 @@ const props = defineProps({
const emit = defineEmits(['buttonBaseClick', 'updataTableColumns']) const emit = defineEmits(['buttonBaseClick', 'updataTableColumns'])
const buttonBaseClick = (val, item, $event) => { const buttonBaseClick = (val, item, $event) => {
let timer = null
if(!timer){
clearButtonBlurHandle($event) //el-button clearButtonBlurHandle($event) //el-button
emit('buttonBaseClick', val, item, $event) emit('buttonBaseClick', val, item, $event)
timer = setTimeout(()=>{
if(timer){
clearTimeout(timer)
}
},2000)
}
} }
const popoverVisible = ref(false) const popoverVisible = ref(false)
// //

Loading…
Cancel
Save