a1300399510@qq.com 提交于 2023/04/06 -16:00:01
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<!-- 结果数量 -->
|
||||
<div class="numberResults flexacenter">大约找到 <div class="number">{{ count }}</div> 条结果</div>
|
||||
<div class="result-box flexacenter" v-if="list.length != 0 || loading">
|
||||
<div class="result-item flexflex" v-for="(item, index) in list" :key="index">
|
||||
<div class="result-item flexflex" v-for="(item, index) in list" :key="index" @click.stop="toDetail(item.tid)">
|
||||
<div class="result-header one-line">
|
||||
<div class="result-label">{{ item.forum }}</div>
|
||||
<div class="result-title" v-html="item.subject"></div>
|
||||
@@ -95,8 +95,11 @@ export default {
|
||||
},
|
||||
|
||||
historicalSearch(val, oldval) {
|
||||
if (val.length > 10) this.historicalSearch.slice(0, 10)
|
||||
this.$store.commit('setHistoricalSearch', val)
|
||||
console.log("val", val);
|
||||
if (val.length > 10) this.historicalSearch = val.slice(0, 10)
|
||||
else this.$store.commit('setHistoricalSearch', val)
|
||||
|
||||
return val
|
||||
},
|
||||
},
|
||||
|
||||
@@ -111,7 +114,8 @@ export default {
|
||||
handleSearchResult() {
|
||||
let kw = this.kw
|
||||
// this.historicalSearch.push(kw)
|
||||
if (!this.historicalSearch.includes(kw)) this.historicalSearch.unshift(kw)
|
||||
console.log("this.historicalSearch", this.historicalSearch);
|
||||
if (!this.historicalSearch.includes(kw)) this.historicalSearch = this.historicalSearch.unshift(kw)
|
||||
|
||||
this.getSearchResult()
|
||||
},
|
||||
@@ -147,7 +151,10 @@ export default {
|
||||
this.getSearchResult()
|
||||
},
|
||||
|
||||
|
||||
// 跳转详情
|
||||
toDetail(tid) {
|
||||
this.$router.push(`/detailIndex?tid=${tid}`)
|
||||
},
|
||||
|
||||
// 点击清空 input 的值
|
||||
emptyKw() {
|
||||
|
||||
Reference in New Issue
Block a user