移动端300毫秒事件响应延迟解决方法[fastclick]

时间:2023-02-10 17:57:16

vue-cli[2.x]中:

安装

npm install fastclick --save

使用:

在main.js中 :先 import fastClick from ‘fastclick‘ 然后 fastClick.attach(document.body)

移动端300毫秒事件响应延迟解决方法[fastclick]移动端300毫秒事件响应延迟解决方法[fastclick]
import Vue from ‘vue‘
import App from ‘./App‘
import router from ‘./router‘
import fastClick from ‘fastclick‘
import ‘./assets/styles/reset.css‘
import ‘./assets/styles/border.css‘

Vue.config.productionTip = false
fastClick.attach(document.body)

/* eslint-disable no-new */
new Vue({
  el: ‘#app‘,
  router,
  components: { App },
  template: ‘<App/>‘
})
main.js