in the project, the array vMurfor is rotated, and then the filter content is displayed according to keyword matching. Using the binary expression of v-if, multiple v-else content appears in the bug, that appears after using v-else. The code is as follows:
<input v-model="filter" type="text" > //0: 1:1 2:2
// item type 0: 1:
<div v-for="(item,index) in list" :key="index" v-if="filter==0?true:filter==item.type?item.type==0?true:false:false">{{item.name}}</div>
<div v-else></div>
<script>
export default {
data() {
return {
filter:0,
list:[
{name:1,type=1},
{name:2,type=1},
{name:3,type=2},
{name:4,type=2},
{name:5,type=3}
]
}
}
}
</script>
look forward to the master"s answer, whether there is a solution, or the place of optimization, thank you