From 326dc16acc9f7a8eb7cb1178cf6e179c797cecf1 Mon Sep 17 00:00:00 2001 From: luJianJun <2587063613@qq.com> Date: Fri, 21 Jul 2023 15:50:58 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E8=BE=93=E5=85=A5=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E4=B9=9F=E8=83=BD=E8=B7=B3=E8=BD=AC"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 9f2dcaa4f494256f2fb4f42f65fba2de46a39b56. --- src/components/seachModule/seachModule.vue | 3 ++- src/components/seachPage/input.vue | 4 ++-- src/views/seachIndex.vue | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/seachModule/seachModule.vue b/src/components/seachModule/seachModule.vue index db82612..6b731ff 100644 --- a/src/components/seachModule/seachModule.vue +++ b/src/components/seachModule/seachModule.vue @@ -161,10 +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) } - if (string.replace(/\s/g, "")) localStorage.setItem('historyArr', JSON.stringify(historyArr.data)); + localStorage.setItem('historyArr', JSON.stringify(historyArr.data)); route.push({ path: '/seachPage', query: { diff --git a/src/components/seachPage/input.vue b/src/components/seachPage/input.vue index 468be4c..ddef97a 100644 --- a/src/components/seachPage/input.vue +++ b/src/components/seachPage/input.vue @@ -3,7 +3,7 @@
- + @@ -211,7 +211,7 @@ let getDataList = props.getDataList //搜索内容 let seachVal = ref('') let isNeedHousing = ref(false) -seachVal.value = route.currentRoute.value.query.keyword.replace(/\s/g, "") +seachVal.value = route.currentRoute.value.query.keyword //判断是否从求房源页面跳转 isNeedHousing.value = route.currentRoute.value.query.isNeedHousing === 'true' diff --git a/src/views/seachIndex.vue b/src/views/seachIndex.vue index ba50657..1a912f5 100644 --- a/src/views/seachIndex.vue +++ b/src/views/seachIndex.vue @@ -182,7 +182,7 @@ onMounted(() => { gutter: 20 }); routeQuery.data = route.currentRoute.value.query - if(routeQuery.data.keyword&&routeQuery.data.keyword.replace(/\s/g, "")){ + if(routeQuery.data.keyword){ inputModuleInfo.value.searchInit(routeQuery.data.keyword)//调用搜索组件的搜索功能 route.currentRoute.value.query.keyword='' }else{