防抖动 节流 防抖节流简单粗暴 throttle & debounce同理

import _ from 'lodash'

onOperationClick:_.debounce(function(state) {

if (state ===0) {

this.deviceId =''

    this.restart_checkbox = []

}else if (state ===1) {

this.dialog_restart_visible =false

  }else if (state ===2) {

const params = {device_id:this.deviceId, device_name:this.restart_checkbox}

this.$api.restartPaePseSvs(params).then(res => {

this.$message.success('重启成功!')

this.dialog_restart_visible =false

    })

}else return

},500)

你可能感兴趣的:(防抖动 节流 防抖节流简单粗暴 throttle & debounce同理)