Jelajahi Sumber

详情页路由问题修复

shilipojs 2 tahun lalu
induk
melakukan
a31d998234
1 mengubah file dengan 7 tambahan dan 10 penghapusan
  1. 7 10
      src/views/career/plan/new-profess-detail.vue

+ 7 - 10
src/views/career/plan/new-profess-detail.vue

@@ -382,16 +382,13 @@ export default {
         if (newVal == 1) this.getCareerProspects()
       }
     },
-    '$route': {
-      immediate: true,
-      handler(val) {
-        console.log(val)
-        this.code = val.query.code
-        this.type =  val.query.type || '本科'
-        if (val.query.code) {
-          this.getOverView()
-        }
-      }
+  },
+  created() {
+    console.log(this.$route.query.code)
+    this.code = this.$route.query.code
+    this.type = this.$route.query.type || '本科'
+    if (this.$route.query.code) {
+      this.getOverView()
     }
   },
   mounted() {