Home  >  Article  >  Web Front-end  >  How to disable double click in uniapp

How to disable double click in uniapp

藏色散人
藏色散人Original
2021-02-03 14:23:394849browse

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);

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!

Statement:
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