a1300399510@qq.com 提交于 2023/04/06 -16:00:01

This commit is contained in:
2023-04-06 16:00:10 +08:00
parent bed54e917e
commit 44554dfceb
3 changed files with 15 additions and 11 deletions

View File

@@ -53,9 +53,8 @@ export default {
watch: {
historicalSearch(val, oldval) {
console.log("val", val);
if (val.length > 10) this.historicalSearch.slice(0, 10)
this.$store.commit('setHistoricalSearch', val)
else this.$store.commit('setHistoricalSearch', val)
}
},
@@ -88,8 +87,8 @@ export default {
toSearchResult(kw) {
if (!kw) return
this.historicalSearch.push(kw)
console.log(this.historicalSearch);
if (!this.historicalSearch.includes(kw)) this.historicalSearch.unshift(kw)
this.$router.push(`/searchResult?kw=${kw}`)