【H5】vue解决因使用vue-awesome-swiper模块,input后留空白问题



methods: {
  inputFocus(){
    clearTimeout(this.timer)
  },
  inputFocusout() {
    this.timer = setTimeout(() => {
      window.scrollTo(0,0)
      // 间隔设为10,减少页面失去焦点定时器的突兀感,
    },10);
  }
},
// 用户离开,就只执行销毁监听事件
destroyed() {
  clearTimeout(this.timer)
}

你可能感兴趣的:(【H5】vue解决因使用vue-awesome-swiper模块,input后留空白问题)