直接非表示にすることができない、埋めるページを更新し、自動的に表示されている最初のピットで、IEブラウザのページ更新中360は再び入力イベントは、他のブラウザを実行しているので、大きな問題があるだろう、リード完全なリストを行います。
<input type="text" class="comHeaderBanSearchSearch fl" placeholder="请输入关键字查询" v-model="inputVal" @keyup.enter="searchBtn">
//在data中 我直接把inputVal的值拿到路由的值 这样页面一进来就不用走watch了 这样就避免了在created中赋值 是inputVal变化从而进行监听 还会走自动补全的函数了
data(){
return {
inputVal:this.$route.query.searchWord?this.$route.query.searchWord:'',
}
}
//监听 watch中
watch:{
inputVal(newVal,oldVal){
this.inputChange();
},
},
methods:{
/*自动补全数据 methods*/
inputChange() {
if(this.inputVal!=''){
getsuggestAPI({
term: this.inputVal,
num: 8
}).then(res => {
if (res.data.status) {
this.suggest = res.data.data;
this.issuggest=true;
this.$store.commit('suggest',this.issuggest)
}
})
}else{
this.suggest=[];
this.issuggest=false;
this.$store.commit('suggest',this.issuggest)
}
},
},