Home > Web Front-end > uni-app > body text

How to disable double click in uniapp

藏色散人
Release: 2023-01-13 00:44:37
Original
4853 people have browsed it

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.

How to disable double click in uniapp

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(&#39;touchend&#39;, function (event) {
              var now = Date.now();
              if (now - lastTouchEnd <= 300) {
                event.preventDefault();
              }
              lastTouchEnd = now;
            }, false);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!