瀏覽代碼

详情页路由问题修复

shilipojs 2 年之前
父節點
當前提交
a31d998234
共有 1 個文件被更改,包括 7 次插入10 次删除
  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() {