推迟执行方法方法:

    delay() { 
      var self = this
      var t
      clearTimeout(t)
      t = setTimeout(function() {
        console.log('3秒后执行')
        // window.eventHub.$emit('refreshList', '')// 更新右侧列表状态
      }, 4000)
    },

 

Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐