Browse Source

热门词语

dev
mk 1 year ago
parent
commit
1924a53048
  1. 8
      src/views/search/index.vue

8
src/views/search/index.vue

@ -10,7 +10,7 @@
<section class='card m-top10' v-else> <section class='card m-top10' v-else>
<div class="title"><span>热门搜索</span></div> <div class="title"><span>热门搜索</span></div>
<van-button type="default" round size="small" class="m-right10 m-top10" v-for="(item, index) in topWordList" <van-button type="default" round size="small" class="m-right10 m-top10" v-for="(item, index) in topWordList"
:key="index" @click="handelClickTopSearch(item.name)">{{ item.name }}</van-button> :key="index" @click="handelClickTopSearch(item)">{{ item}}</van-button>
</section> </section>
<div class="card" v-if="searchFlag"> <div class="card" v-if="searchFlag">
<van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getTable"> <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="getTable">
@ -38,7 +38,7 @@ export default {
], ],
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
topWordList: {} topWordList: []
}; };
}, },
created() { created() {
@ -87,8 +87,8 @@ export default {
}, },
async popularSearch() { async popularSearch() {
const res = await popularSearch() const res = await popularSearch()
if (res.code == 0) { if (res) {
this.topWordList = res.data this.topWordList = res
} else { } else {
this.$toast(res.msg) this.$toast(res.msg)
} }

Loading…
Cancel
Save