V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
hastyfish
V2EX  ›  问与答

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

  •  
  •   hastyfish · 2019-06-15 15:07:06 +08:00 · 1572 次点击
    这是一个创建于 1770 天前的主题,其中的信息可能已经有所发展或是发生改变。

    然后一刀戳死 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
    但是主题就是显示不出来

    第 1 条附言  ·  2019-06-15 18:51:22 +08:00
    问题解决了
    6 条回复    2019-06-18 10:29:02 +08:00
    leo1211
        1
    leo1211  
       2019-06-15 15:19:41 +08:00 via Android
    VR 帮你啊老弟 还是多看点积极健康的哈
    Valid
        2
    Valid  
       2019-06-15 16:13:06 +08:00
    你需要一条项链,然后戳一下回车键
    Valid
        3
    Valid  
       2019-06-15 16:13:13 +08:00
    azh7138m
        4
    azh7138m  
       2019-06-15 16:16:33 +08:00
    我还以为是进去找老婆(笑
    ryd994
        5
    ryd994  
       2019-06-15 16:32:07 +08:00
    你确定不是你被 bug 戳死?
    elementpps1
        6
    elementpps1  
       2019-06-18 10:29:02 +08:00
    一般电影里都是病毒杀死了创世主
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5236 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 07:28 · PVG 15:28 · LAX 00:28 · JFK 03:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.