children안에 { } 만들기
"/detail/:id/author" "/detail/:id/comment"로 접속{ path : "/detail/:id", component : Detail, children : [ { path : "author", // '/' 필요 X component : Author.vue, }, { path : "comment", component : Comment.vue, }, ] },
그리고 어디서 보여줄 지 보여줄 곳에
<router-view></router-view> ``` 표시
@click="$router.push('/')" - 클릭 시 원하는 url로 이동
@click="$router.go(-1)" - 웹브라우저의 히스토리에서 뒤로 한칸
@click="$router.go(2)" - 앞으로 두칸
path : "/list",
component : {
List : List,s
Comment : Comment,
},
{
path : "/list",
redirection : { name : 'homepage' }
}