【发布时间】:2017-09-16 12:48:27
【问题描述】:
所以我有这样的路线:
const routes = [{
path: '/',
component: Home,
children: [
{
path: "/health"
children: [
{
path: 'overview'
component: Overview
},
{
path: 'blood',
component: Blood
}
]
}
]
}]
在 Home 组件中我有这样的东西:
<template>
<div id="home">
<router-view></router-view>
</div>
</template>
但是当我导航到/health/overview 和/health/blood 路由时,与组件对应的模板不会呈现。我检查了应用程序$route 对象,它们正确检测到路由和组件。只是模板不会呈现。如果有帮助,我的App.vue 中还有一个<router-view>。
不可能有多个嵌套路由吗?还是我错过了什么?
【问题讨论】:
标签: javascript vue.js vuejs2 vue-component vue-router