<template>
<div>
<input type="text" v-model="mytext">{{mytext}}
<ul>
<li v-for="(item,key) in app()" :key='key'>
{{item}}
</li>
</ul>
</div>
</template>
<script>
export default {
data(){
return{
mytext:'',
datalist:['dasdd','dasda','gfadas','tadfvvc','cnbasm','pgionww'],
newList:[]
}
},
methods:{
app(){
return this.datalist.filter(item =>item.includes(this.mytext))
// console.log(newList)
}
}
}
</script>