|
|
@@ -6,7 +6,7 @@
|
|
|
<a @click="cancelSearch">取消</a>
|
|
|
</div>
|
|
|
<ul class="associate-list" v-show="associate.show">
|
|
|
- <li @click="onAssociateClick(similar)" v-for="similar in similarKeywords">
|
|
|
+ <li @click="onAssociateClick(similar)" v-for="similar in similarKeywords.all">
|
|
|
<i class="icon-sousuo iconfont"></i>
|
|
|
<span>{{similar}}</span>
|
|
|
</li>
|
|
|
@@ -14,7 +14,7 @@
|
|
|
</ul>
|
|
|
<div class="hot-history" v-show="!associate.show">
|
|
|
<div class="search-history" v-if="searchHistory && searchHistory.length > 0">
|
|
|
- <p>历史搜索</p>
|
|
|
+ <p>历史搜索<i class="iconfont icon-lajitong" @click="deleteHistory"></i></p>
|
|
|
<ul>
|
|
|
<li v-for="item in searchHistory" @click="onSearch(item.keyword)">
|
|
|
<a>{{item.keyword}}</a>
|
|
|
@@ -98,6 +98,11 @@
|
|
|
},
|
|
|
cancelFocus: function () {
|
|
|
document.getElementById('search-box').blur()
|
|
|
+ },
|
|
|
+ deleteHistory () {
|
|
|
+ this.$http.delete('/search/searchHistory').then(response => {
|
|
|
+ this.$store.dispatch('searchData/getSearchHistory')
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
@@ -213,6 +218,11 @@
|
|
|
>p {
|
|
|
font-size: .3rem;
|
|
|
color: #333;
|
|
|
+ i {
|
|
|
+ font-size: .3rem;
|
|
|
+ float: right;
|
|
|
+ margin-right: 0.4rem;
|
|
|
+ }
|
|
|
}
|
|
|
ul {
|
|
|
text-align: left;
|