What is the method for vue.js to filter the search box
The main content of this article is to explain "what is the method of vue.js screening search box", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "what is the method of vue.js filtering search box"!
List of all content
Let's take a look at the relevant code directly, as follows:
Filter small case search
Gender: all men and women
Id name, gender {{item.id}} {{item.name}} {{item.gender}} New Vue ({el:'# app' Data: {filterByName:', filterByGender:', inputName:'' Users: [{id: 1, name: 'Jack' Gender: 'male'}, {id: 2 Name: 'abc', gender:' female'} {id: 3, name: 'vaxc' Gender: 'male'}, {id: 4 Name: 'awe2', gender:' female'} {id: 5, name: 'ave' Gender: 'male'}]} Computed: {filterUsers () {return this.users.filter (u = > u.name.includes (this.filterByName) & & u.gender.includes (this) .filterByGender)}) so far I believe that you have a deeper understanding of "what is the method of vue.js filtering search box", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!