Home > Web Front-end > JS Tutorial > Vue determines whether the input content has spaces

Vue determines whether the input content has spaces

php中世界最好的语言
Release: 2018-04-12 14:56:42
Original
5784 people have browsed it

This time I will bring you vue to determine whether the input content has spaces. vue determines whether the input content has spaces. What are the precautions? What are the following? This is a practical case, let’s take a look at it.

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

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

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

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

How to implement Yuansheng JS todolist function

FileReader implements local preview before uploading pictures

How does Element-ui operate the table to change the table content

The above is the detailed content of Vue determines whether the input content has 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