html5 - A problem with using vue components to implement functions
扔个三星炸死你
扔个三星炸死你 2017-06-17 09:17:03
0
2
847

As shown in the figure: Click the clear button to clear the input text. Since the input loses focus at this time, the corresponding clear button will also be hidden.
Need to be solved: When clearing the input text, the focus is still on the input, and the clear button is still displayed.

扔个三星炸死你
扔个三星炸死你

reply all(2)
黄舟

.focus() can control input and focus. If there is no content clearly displayed, this logic is wrong.

阿神

"When clearing the input text, the focus is still on the input, and the clear button is still displayed." It's very simple. After the onSpanTag function clears the content, manually set the input focus and then set the clear button to display:

document.querySelector("#input").focus(); 
this.states = true;
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!