输入内容为空也能跳转

This commit is contained in:
2023-07-21 15:49:41 +08:00
parent d53616c347
commit 9f2dcaa4f4
3 changed files with 4 additions and 5 deletions

View File

@@ -161,11 +161,10 @@ 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: {