Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save israeleriston/19d7bffb9d948d4dd25c35937fed3867 to your computer and use it in GitHub Desktop.
Save israeleriston/19d7bffb9d948d4dd25c35937fed3867 to your computer and use it in GitHub Desktop.
Erro in Nested Routes Vuejs
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