Home  >  Article  >  Web Front-end  >  How to hide the soft keyboard in vue.js

How to hide the soft keyboard in vue.js

coldplay.xixi
coldplay.xixiOriginal
2020-12-07 14:35:593022browse

Vue.js method to hide the soft keyboard: 1. Click the keyboard start button to hide the soft keyboard. The code is [this.$refs.inputText.blur();]; 2. Click the input input box and the soft keyboard will be hidden. The keyboard is displayed, the code is [this.$refs.inputText.focus()].

How to hide the soft keyboard in vue.js

The operating environment of this tutorial: Windows 7 system, Vue version 2.9.6, Dell G3 computer. This method is suitable for all brands of computers.

【Recommended related articles: vue.js

vue.js method to hide the soft keyboard:

Soft Keyboard, the so-called soft keyboard is not on the keyboard, but on the "screen". The soft keyboard uses software to simulate the keyboard and input characters by clicking the mouse to prevent Trojans from recording keyboard input. Passwords are generally easy to see on some banks' websites where they require you to enter your account number and password.

Soft Keyboard can be divided into the following three types:

  • software virtual keyboard,

  • comes with the system Keyboard,

  • new silicone keyboard.

<input type="text" ref="inputText" autofocus="autofocus" @keyup.enter="clickInput">

Click the input box, the soft keyboard is displayed:

this.$refs.inputText.focus();

Click the keyboard start key, the soft keyboard is hidden:

this.$refs.inputText.blur();

Related free Learning recommendation: javascript(video)

The above is the detailed content of How to hide the soft keyboard in vue.js. 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