Created
June 24, 2017 05:58
-
-
Save israeleriston/19d7bffb9d948d4dd25c35937fed3867 to your computer and use it in GitHub Desktop.
Erro in Nested Routes Vuejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { routes as auth } from './auth' | |
import { routes as home } from './home' | |
import Content from 'components/root/Content' | |
caminho padrao de rota é '/' após o usuario efetuar login. | |
Segundo a documentação quando eu realizar matched na rota '/', o conteudo da rota home será renderizado dentro do componente | |
da rota pai, porém isso não esta acontencendo, segue em anexo as rotas. | |
rota root | |
const router = { | |
name: 'content', | |
path: '/', | |
component: Content, | |
children: [ | |
...home | |
] | |
} | |
HTML do content.vue | |
<template lang="html"> | |
<div> | |
teste do content | |
<router-view></router-view> | |
</div> | |
</template> | |
HTML do home.vue | |
<template> | |
<div> | |
home | |
</div> | |
</template> | |
rota filha | |
import Home from '../components/Home.vue' | |
export default [ | |
{ | |
name: 'home-view', | |
path: '', | |
component: Home, | |
meta: { requiresAuth: true } | |
} | |
] | |
Template content | |
<template lang="html"> | |
<div> | |
teste do content | |
<router-view></router-view> | |
</div> | |
</template> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment