Fix:3615 【商城小程序】历史搜索词条搜索后未显示在最前方
This commit is contained in:
@@ -252,7 +252,8 @@ export default {
|
|||||||
setHistory(word) {
|
setHistory(word) {
|
||||||
const index = this.historyKey.findIndex(item => item.word === word)
|
const index = this.historyKey.findIndex(item => item.word === word)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
return
|
this.historyKey.splice(index, 1)
|
||||||
|
// return
|
||||||
}
|
}
|
||||||
this.historyKey.unshift({id: this.$global.generateMixed(10), word })
|
this.historyKey.unshift({id: this.$global.generateMixed(10), word })
|
||||||
uni.setStorageSync('historyKey', JSON.stringify(this.historyKey))
|
uni.setStorageSync('historyKey', JSON.stringify(this.historyKey))
|
||||||
|
|||||||
Reference in New Issue
Block a user