a1300399510@qq.com 提交于 2023/04/06 -14:40:01

This commit is contained in:
2023-04-06 14:40:10 +08:00
parent 482193fbee
commit 287bc37315
3 changed files with 22 additions and 17 deletions

View File

@@ -54,7 +54,7 @@ export default {
watch: {
historicalSearch(val, oldval) {
if (val.length > 10) this.historicalSearch.slice(0, 10)
localStorage.setItem('historicalSearch', JSON.stringify(val));
this.$store.commit('setHistoricalSearch', val)
}
},
@@ -98,13 +98,6 @@ export default {
if (this.searchText.length > 0) this.showClear = true
else this.showClear = false
// let hotSearchkeywords = ["香港大学", "香港大学"]
// console.log(JSON.stringify(hotSearchkeywords));
this.historicalSearch = JSON.parse(localStorage.getItem('historicalSearch')) || []
console.log(this.historicalSearch);
}
}
</script>