Home > Article > Web Front-end > How to disable double click in uniapp
Uniapp method to disable double-click: first open the corresponding code file; then modify the code to "if (now - lastTouchEnd <= 300){event.preventDefault();}lastTouchEnd=now;},false. ..” That’s it.
The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, DELL G3 computer.
uniapp prohibits double-clicking to enlarge
//禁止双击放大 var lastTouchEnd = 0; document.documentElement.addEventListener('touchend', function (event) { var now = Date.now(); if (now - lastTouchEnd <= 300) { event.preventDefault(); } lastTouchEnd = now; }, false);
uni-app introduction
uni-app is a cross-platform application developed using Vue.js Front-end framework.
Developers write Vue.js code, and uni-app compiles it to multiple platforms such as iOS, Android, and WeChat applets to ensure that it runs correctly and achieves an excellent experience.
uni-app inherits from Vue.js and provides a complete Vue.js development experience.
uni-app component specification and extension API are basically the same as WeChat applet.
Recommended: "uniapp tutorial"
The above is the detailed content of How to disable double click in uniapp. For more information, please follow other related articles on the PHP Chinese website!