Fix:3615 【商城小程序】历史搜索词条搜索后未显示在最前方

This commit is contained in:
LinCyJang
2025-06-02 10:02:45 +08:00
parent 6e4a217873
commit 53457ba83c
+2 -1
View File
@@ -252,7 +252,8 @@ export default {
setHistory(word) {
const index = this.historyKey.findIndex(item => item.word === word)
if (index > -1) {
return
this.historyKey.splice(index, 1)
// return
}
this.historyKey.unshift({id: this.$global.generateMixed(10), word })
uni.setStorageSync('historyKey', JSON.stringify(this.historyKey))