Explorar o código

切换省份时重新获取本省规则数据

shmily1213 hai 2 semanas
pai
achega
002437847d
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      src/pagesMain/pages/index/components/index-map.vue

+ 8 - 0
src/pagesMain/pages/index/components/index-map.vue

@@ -100,6 +100,8 @@ const maps = computed<SiteMap[]>(() => [{
   pagePath: routes.voluntaryIndex
 }])
 
+const location = computed(() => userStore.getLocation);
+
 const handleMap = (m: SiteMap) => {
   if (m.handler) return m.handler()
   if (!m.pagePath) return
@@ -118,6 +120,12 @@ const loadData = () => {
 onLoad(() => {
   loadData();
 });
+watch(location, () => {
+  console.log('location', location.value)
+  if (location.value) {
+    loadData();
+  }
+});
 </script>
 
 <style scoped></style>