From 0dcd0a11b5671f0149303069fb19406719d38504 Mon Sep 17 00:00:00 2001
From: Mila <Mila@pollex.com.tw>
Date: 星期一, 06 十二月 2021 12:37:32 +0800
Subject: [PATCH] fixed 我的顧問清單: refresh 頁面時, 重新判斷 activeTabName

---
 PAMapp/pages/myConsultantList.vue |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/PAMapp/pages/myConsultantList.vue b/PAMapp/pages/myConsultantList.vue
index d935c8d..62173cf 100644
--- a/PAMapp/pages/myConsultantList.vue
+++ b/PAMapp/pages/myConsultantList.vue
@@ -26,7 +26,6 @@
 
 <script lang='ts'>
 import { Vue, Component, Watch, State, Action } from 'nuxt-property-decorator';
-import { Route } from 'vue-router/types/router.d'
 import { Consultants } from '~/assets/ts/api/consultant';
 
 @Component
@@ -51,6 +50,10 @@
 
     mounted() {
         this.storeConsultantList();
+
+        if (this.$route.name) {
+         this.activeTabName = this.$route.name.split('-')[1]
+        }
     }
 
     filterContactedList() {
@@ -60,11 +63,6 @@
         this.contactedList = (this.myConsultantList || [])
                 .filter(item => item.contactStatus === 'contacted')
                 .sort((a, b) => a.updateTime > b.updateTime ? -1 : 1);
-    }
-
-    @Watch('$route') watchRouter(currentRoute: Route) {
-        const pathArray = currentRoute.fullPath.split('/');
-        this.activeTabName = pathArray[pathArray.length - 1];
     }
 
 }

--
Gitblit v1.8.0