防抖方法123

//防抖
const antiShake = (time: number) => {
  return setTimeout(() => {
    getList()
  }, time)
}
let timer: any = null
watch(
  [() => formState.action],
  () => {
    clearTimeout(timer)
    timer = antiShake(100)
  },
  { deep: true }
)

watch(formState, handleClickIcon, {
  deep: true
})

你可能感兴趣的:(前端,javascript,html)