<input type="text" v-model="filterText2"> <template v-for="(item,index) in viewDictionArr"> <li>{{item}}</li> </template>
data(){ return { filterText2:"", typeList:[], } }, computed: { viewDictionArr(){ let arr = []; for(var i = 0; i < this.typeList.length; i++) { if(this.filterText2 != '' && this.typeList[i].value.indexOf(this.filterText2) != -1){ arr.push(this.typeList[i]); }else if(this.filterText2 == ''){ arr.push(this.typeList[i]); } } return arr; } },