有的时候我真的想钻到电脑里面去

2019-06-15 15:07:06 +08:00
 hastyfish

然后一刀戳死 bug
关于 elementUI+vue 导航栏跳不到对应的路由,求救

<template>

  <el-container style="height: 500px; border: 1px solid #eee">
  
    <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
      <el-menu class="el-menu-vertical-demo"
               :default-active="defaultActive"
               router>
        <el-submenu :index="college.collegeId"
                    v-for="college in show.college">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>{{college.collegeName}}</span>
          </template>
            <el-menu-item :index="professional.professionalId"
                          v-for="professional in college.professionalList">
              {{professional.professionalName}}
            </el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside>
    
    
    <el-container>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
    
    
  </el-container>
</template>

<script>
  export default {
    name: "aside1",
    data() {
     略
    },
    computed: {
      defaultActive: function(){
        return this.$route.path.replace('/', '');
      }
    },
  }
</script>

这是 router 的

import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
const collegePage = r => require.ensure([], () => r(require('@/page/collegePage')), 'collegePage');
const routes = [
  {
    path: '/',
    children:[
      {
        path: '/:id',
        component: collegePage
      }
    ]
  },{
    path:'/:id',
    component:collegePage
  }
]
export default new Router({
  mode:'history',
  routes,
  strict: process.env.NODE_ENV !== 'production',
})

数据都可以显示,url 地址也的确变成了 http://localhost:8080/0201
但是主题就是显示不出来

1582 次点击
所在节点    问与答
6 条回复
leo1211
2019-06-15 15:19:41 +08:00
VR 帮你啊老弟 还是多看点积极健康的哈
Valid
2019-06-15 16:13:06 +08:00
你需要一条项链,然后戳一下回车键
Valid
2019-06-15 16:13:13 +08:00
azh7138m
2019-06-15 16:16:33 +08:00
我还以为是进去找老婆(笑
ryd994
2019-06-15 16:32:07 +08:00
你确定不是你被 bug 戳死?
elementpps1
2019-06-18 10:29:02 +08:00
一般电影里都是病毒杀死了创世主

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/574213

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX