Vue mobile terminal 300 millisecond latency issues --fastclick click event

In vue projects sometimes 300 milliseconds click event of the mobile terminal latency issues, you need to install fastclick library to solve

1. Open the Vue project, select the project, hold down shift and right single note, select [Open powershell window (s) here], enter the command: CNPM install Fastclick --save

If you install Taobao mirroring CNPM install Fastclick --save, if not installed using npm install Fastclick --save

2. main.js project folder, introduced fastclick

import  fastClick from 'fastclick'

fastClick.attach (document.body)    // will fastclick own method to bind to the top of document.body

This allows the introduction of the right fastclick library solve the problem ~ 300 ms delay clicks

Guess you like

Origin www.cnblogs.com/qdkfyym/p/11447189.html