Commit 5456a7d7 by amateur

代码 优化

1 parent b0785da9
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<nafm-header navClass="nafmii-head-bg3"> <nafm-header navClass="nafmii-head-bg3">
<SearchInput class="search-input" v-model="keyword" :placeholder="$t('home.searchPlaceholder')" @search="handleSearch" /> <SearchInput class="search-input" v-model="keyword" :placeholder="$t('home.searchPlaceholder')" @search="handleSearch" />
</nafm-header> </nafm-header>
<div class="history-container" v-if="history"> <div class="history-container" v-if="history" @jumpPage="emitSearchValue">
<SearchHistory stateKey="Home" /> <SearchHistory stateKey="Home" />
</div> </div>
<SearchDataLayout v-else /> <SearchDataLayout v-else />
...@@ -28,6 +28,10 @@ export default { ...@@ -28,6 +28,10 @@ export default {
methods: { methods: {
handleSearch (val) { handleSearch (val) {
this.$store.dispatch('search/APushHomeSearchValue', val) this.$store.dispatch('search/APushHomeSearchValue', val)
this.emitSearchValue(val)
},
emitSearchValue (val) {
this.$emit('search', val) this.$emit('search', val)
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!