Home > Web Front-end > JS Tutorial > How to use vue to determine if the input content is all spaces?

How to use vue to determine if the input content is all spaces?

亚连
Release: 2018-06-02 10:04:17
Original
2481 people have browsed it

Below I will share with you a method for Vue to determine that the input content is all spaces. It has a good reference value and I hope it will be helpful to everyone.

For example, the data in input and the msg in data are two-way bound.

Then we can judge by splitting msg into arrays with spaces, and then splicing them together to determine the length of the string. If the length is 0, it proves that the input is all spaces, as follows:

msg.split(" ").join("").length = 0
Copy after login

The above is what I compiled for everyone. I hope it will be helpful to everyone in the future.

Related articles:

Methods for cross-domain requests through jQuery JSONP (detailed tutorial)

How to learn process and child_process in node Module (detailed tutorial)

Loop through and load different images in vue2.0 (detailed tutorial)

The above is the detailed content of How to use vue to determine if the input content is all spaces?. 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