// 搜索按钮
serachBtn() {
const history = this.searchHistory
const query = this.searchKey
if (!query) {
this.$message.info('请输入搜索内容')
return false
}
// 找到有没有重复的
if (!history.some(item => item === query)) {
let hist = [query].concat(history).slice(0, 10)
this.searchHistory = hist
// 持久化存储历史记录
uni.setStorageSync('searchHistory', hist)
}
this.searchKey = ""
}