Commit 8e1675c5 authored by shilei's avatar shilei

fix: 城市切换首页回显

parent 8b6455f5
......@@ -11,7 +11,9 @@ body {
WenQuanYi Micro Hei,
sans-serif;
}
:root {
--el-menu-hover-bg-color: none !important;
}
.el-container {
min-width: 1366px !important;
}
......
......@@ -163,7 +163,6 @@ import { computed, ref, onMounted, watch } from 'vue';
import { useJump } from '@/composable/useJump.ts';
import { RouteName } from '@/router/router.ts';
import { useRoute } from 'vue-router';
// import cookie from 'js-cookie';
import { useCity } from '@/composable/useCity.ts';
import type { DropdownInstance } from 'element-plus';
import type { RouteLocationRaw } from 'vue-router';
......@@ -245,6 +244,21 @@ onMounted(() => {
console.log('city', city, route);
if (city) {
currentCity.value = city as string;
} else if (searchParamsStore.globalProvinceName) {
for (const tempList of cityList) {
if (
tempList.items.filter(
(item) => searchParamsStore.globalProvinceName.replace(/\s+/g, '').indexOf(item) > -1,
).length
) {
for (const tempCity of tempList.items) {
currentCity.value =
searchParamsStore.globalProvinceName.replace(/\s+/g, '').indexOf(tempCity) > -1
? tempCity
: currentCity.value;
}
}
}
}
}, 0);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment