搜索框为空不能搜索

This commit is contained in:
luJianJun 2023-07-31 12:18:33 +08:00
parent 6e93d4de52
commit b336d86af1

View File

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