Commit 1b48012e authored by Damon's avatar Damon

fix: 搜索不输入内容兼容

parent 21f1b24d
...@@ -176,6 +176,7 @@ export default { ...@@ -176,6 +176,7 @@ export default {
this.arrIndex = e.show ? e.index : null this.arrIndex = e.show ? e.index : null
}, },
search(val) { search(val) {
if (val){
this.keyword = val this.keyword = val
let history = this.searchHistory let history = this.searchHistory
history.unshift(val) history.unshift(val)
...@@ -183,6 +184,7 @@ export default { ...@@ -183,6 +184,7 @@ export default {
history.splice(9, 1) history.splice(9, 1)
} }
this.$u.vuex('searchHistory', history) this.$u.vuex('searchHistory', history)
}
}, },
collection(item) { collection(item) {
const action = item.collectionFlag ? 'removeCollection' : 'joinCollection' const action = item.collectionFlag ? 'removeCollection' : 'joinCollection'
......
...@@ -62,6 +62,7 @@ export default { ...@@ -62,6 +62,7 @@ export default {
}, },
methods: { methods: {
search(val) { search(val) {
if (val){
this.keyword = val this.keyword = val
this.history.unshift(val) this.history.unshift(val)
if(this.history.length > 9){ if(this.history.length > 9){
...@@ -69,6 +70,7 @@ export default { ...@@ -69,6 +70,7 @@ export default {
} }
this.$u.vuex('searchHistory', this.history) this.$u.vuex('searchHistory', this.history)
this.toSearchDetail(val) this.toSearchDetail(val)
}
}, },
toSearchDetail(keyword) { toSearchDetail(keyword) {
this.$u.route({ this.$u.route({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment