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
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!