Created
April 2, 2018 13:09
-
-
Save matthieu-D/593dd8e023d85129c9a875de2c647b2f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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