zhangxiaoxu123456
2022-04-18 a3abdf4cb6ea6ba057da0ae1b6af15497dbe2044
路由跳转
2个文件已修改
30 ■■■■■ 已修改文件
src/pages/components/showIndexTitle.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/router.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/showIndexTitle.vue
@@ -2,8 +2,7 @@
  <div class="showIndexTitle-wrap">
    <h1 class="title">石家庄人社局业务运行数据分析平台</h1>
    <el-menu
      default-active="/index"
      :class="activeStyle"
      :default-active="activeIndex"
      router
      mode="horizontal"
      class="el-menu-demo"
@@ -75,21 +74,18 @@
<script>
export default {
  name: "showIndexTitle",
  watch: {
    '$route' (toRouter, fromRouter) {
        console.log(toRouter,'toRouter')
        console.log(fromRouter,'fromRouter')
        console.log('$route.path---',this.$route)
  data() {
    return {
        activeStyle: false,
        activeIndex: '/index'
    }
  },
    data() {
      return {
          activeStyle: false
      }
    },
  mounted() {
      this.$route.meta.routerParent && (this.activeIndex = '/' + this.$route.meta.routerParent)
  },
  methods: {
  }
  },
};
</script>
src/router/router.js
@@ -167,7 +167,7 @@
      children:[
        {
          path: "/personnelTalents_unitPersonnel",
          meta: {title: "事业单位人员情况"},
          meta: {title: "事业单位人员情况", routerParent: 'personnelTalents'},
          name: "/PersonnelTalents_unitPersonnel",
          component: () =>
            import(
@@ -176,7 +176,7 @@
        },
        {
          path: "/personnelTalents_greenCard",
          meta: {title: "人才绿卡补贴"},
          meta: {title: "人才绿卡补贴", routerParent: 'personnelTalents'},
          name: "/PersonnelTalents_GreenCard",
          component: () =>
            import(
@@ -200,7 +200,7 @@
      children: [
        {
          path: "/otherB-PeopleJunShouRu",
          meta: {title: "居民人居收入、可支配收入"},
          meta: {title: "居民人居收入、可支配收入", routerParent: 'OtherBusiness'},
          name: "otherB-PeopleJunShouRu",
          component: () =>
            import(
@@ -209,7 +209,7 @@
        },
        {
          path: "/otherB-GongGuTuoPin",
          meta: {title: "居民人居收入、可支配收入"},
          meta: {title: "居民人居收入、可支配收入", routerParent: 'OtherBusiness'},
          name: "otherB-GongGuTuoPin",
          component: () =>
            import(