import { throttle } from 'throttle-debounce'
- 节流防抖
- 防抖 多次点击执行最后一次
- 节流 多次点击执行第一次
clickConfirmImport: throttle(3000,function () {
if (this.fileList.length === 0) {
this.$message.warning('请上传文件')
return
}
this.$alert('提交成功,正在执行异步导入;导入结果将在消息中心进行通知', '导入成功', {
confirmButtonText: '确定',
customClass: 'scope-element-container__wrap success'
}).then(() => {
console.info('取消')
})
}, { noTrailing: true }),
noTrailing 为 false 节流 会执行最后一次