Commit 420b1a46 by amateur

搜索历史缓存

1 parent 6387f177
......@@ -5,7 +5,7 @@
</nafm-header>
<div class="content-layout">
<SearchHistory v-if="history" stateKey="Home" @jumpPage="emitSearchValue" />
<SearchDataLayout v-else :data="searchData"/>
<SearchDataLayout v-else :data="searchData" />
</div>
</div>
</template>
......@@ -23,7 +23,8 @@ export default {
},
data () {
return {
keyword: ''
keyword: '',
lastKeyword: null
}
},
......@@ -35,7 +36,10 @@ export default {
methods: {
handleSearch (val) {
this.$store.dispatch('search/APushHomeSearchValue', val)
if (val != this.lastKeyword) {
this.$store.dispatch('search/APushHomeSearchValue', val)
this.lastKeyword = val
}
this.emitSearchValue(val)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!