Browse Source

baiyou - menus & route fit

何海涛 1 year ago
parent
commit
c69d10cc08
1 changed files with 12 additions and 2 deletions
  1. 12 2
      src/views/index/components/index-card-news.vue

+ 12 - 2
src/views/index/components/index-card-news.vue

@@ -29,18 +29,28 @@ export default {
   components: {IndexCard},
   data() {
     return {
-      morePath: {name: 'NewsAll'},
+      morePaths: {
+        '中考资讯': {name: 'NewsMiddleExam'},
+        '家长学校': {name: 'NewsParentSchool'},
+        '中考学生辅导': {name: 'NewsMiddleAssistant'},
+        '心灵课堂': {name: 'NewsHeartClass'}
+      },
       newsTypes: [],
       activeName: '',
       newsCache: {}
     }
   },
+  computed: {
+    morePath() {
+      return this.morePaths[this.activeName]
+    }
+  },
   mounted() {
     this.getTypes()
   },
   methods: {
     getTypes() {
-      this.newsTypes = ['中考资讯','家长学校','中考学生辅导','心灵课堂']
+      this.newsTypes = ['中考资讯', '家长学校', '中考学生辅导', '心灵课堂']
       this.activeName = this.newsTypes.first()
       this.getList(this.activeName)
     },