Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created April 2, 2018 13:09
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 matthieu-D/593dd8e023d85129c9a875de2c647b2f to your computer and use it in GitHub Desktop.
Save matthieu-D/593dd8e023d85129c9a875de2c647b2f to your computer and use it in GitHub Desktop.
const FirstChild = {
template: "<div>Hi I'm the first child</div>"
};
const SecondChild = {
template: "<div>Hi I'm the second child</div>"
};
const ParentComponent = {
template: `<div>
Hi I'm the parent, I will stay here
<router-view></router-view>
<router-link to="/parent/first-child">First Child</router-link>
<router-link to="/parent/second-child">Second Child</router-link>
</div>
`
};
const ParentRoute = {
path: "/parent",
name: "parent",
component: ParentComponent,
children: [
{
path: "first-child",
component: FirstChild
},
{
path: "second-child",
component: SecondChild
}
]
};
const routes = [
ParentRoute
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment