a1300399510@qq.com 提交于 2023/04/06 -16:00:01
This commit is contained in:
@@ -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}`)
|
||||
|
||||
Reference in New Issue
Block a user