搜索为空可以跳转搜索页

This commit is contained in:
2023-07-21 16:14:58 +08:00
parent a8e75b0f98
commit da63d7358e
3 changed files with 12 additions and 8 deletions

View File

@@ -161,11 +161,11 @@ historyArr.data = JSON.parse(localStorage.getItem('historyArr')) || []
let seachList = (item) => {
// console.log(123)
let string = seachAllType.keyword
if (!string.replace(/\s/g, "")) return
if (historyArr.data.indexOf(seachAllType.keyword) === -1) {
historyArr.data.push(seachAllType.keyword)
}
localStorage.setItem('historyArr', JSON.stringify(historyArr.data));
if (string.replace(/\s/g, ""))localStorage.setItem('historyArr', JSON.stringify(historyArr.data));
route.push({
path: '/seachPage',
query: {