Merge branch 'hotfixbug'

This commit is contained in:
weipengfei 2024-04-20 13:38:59 +08:00
commit 2fe1825c77

View File

@ -294,10 +294,13 @@
}, },
searchBut: function() { searchBut: function() {
if(this.searchValue!='') { if(this.searchValue!='') {
this.historyList.unshift({ let t = this.historyList.findIndex(item=>item.word==this.searchValue);
let list = [...this.historyList];
if(t!=-1) list.splice(t, 1);
list.unshift({
word: this.searchValue word: this.searchValue
}); });
uni.setStorageSync('historyList', this.historyList); uni.setStorageSync('historyList', list);
} }
if (this.back) { if (this.back) {
return uni.navigateBack({ return uni.navigateBack({