Revert "输入内容为空也能跳转"

This reverts commit 9f2dcaa4f494256f2fb4f42f65fba2de46a39b56.
This commit is contained in:
luJianJun 2023-07-21 15:50:58 +08:00
parent 9f2dcaa4f4
commit 326dc16acc
3 changed files with 5 additions and 4 deletions

View File

@ -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: {

View File

@ -3,7 +3,7 @@
<div class="body-maxWidth ">
<div class="input-box dis-f al-item jus-bet body-maxWidth">
<div class="dis-f al-item">
<el-input v-model="seachVal" class="input-s" placeholder="搜索房源或输入房源ID" @keyup.enter='seachList'>
<el-input v-model="seachVal" class="input-s" placeholder="输入关键字" @keyup.enter='seachList'>
<template #suffix>
<img src="../../assets/homeImage/seachIcon.svg" class="icon" alt="" @click="seachList">
</template>
@ -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'

View File

@ -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{