Pārlūkot izejas kodu

fix:修改页面参数不生效问题

wangsisi 3 dienas atpakaļ
vecāks
revīzija
da08a1d6a5

+ 4 - 2
src/views/old_mini/modify_work/completedWork.vue

@@ -452,7 +452,8 @@ const handleUploadSuccess = () => {
         isGoBack.value = false;
         if(showBack.value){
             router.replace({
-                path: "/task_condition?active=1",
+                path: "/task_condition",
+                query: { active: '1' }
             });
         }else{
             router.back();
@@ -471,7 +472,8 @@ const toList = (val) => {
 const handleClose = () => {
     if(showBack.value){
         router.replace({
-            path: "/task_condition?active=1",
+            path: "/task_condition",
+            query: { active: '1' }
         });
     }else{
         router.back();

+ 5 - 2
src/views/old_mini/task_condition/index.vue

@@ -14,7 +14,7 @@
 </template>
 
 <script setup>
-import { ref, onMounted } from "vue";
+import { ref, onMounted, onActivated } from "vue";
 import { Tab, Tabs } from "vant";
 // import demandHall from "../farm_manage/components/demandHall.vue";
 import interact from "./components/interact.vue";
@@ -33,10 +33,13 @@ const getManagerList = async () => {
     }
 };
 onMounted(() => {
+    getManagerList();
+});
+
+onActivated(() => {
     if(route.query.active){
         active.value = Number(route.query.active);
     }
-    getManagerList();
 });
 </script>