Browse Source

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

shmily1213 2 tuần trước cách đây
mục cha
commit
002437847d
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  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>