HTML:
<input v-model="search" />
<tbody v-for="item in searchMethod">
<tr >
<td>{{item.id}}</td>
<td>{{item.JhNum}}</td>
</tr>
</tbody>
JS:
data() {
return {
msg: 'Welcome to Your Vue.js App',
name: '',
items :[], //axios获取
search:''
}
},
computed: {
searchMethod:function() {
return this.items.filter(item => {
return item.JhNum.match(this.search)}
)}
}