I've got a question about keep-alive in vue-router. I want to create a list-detail structured app, so I need to refresh the detail comp every time but keep the scroll position of the list comp. As the list comp and the detail comp are under different routes, I don't know how to solve this. If I add keep-alive to router-view
, they both keep their scroll position, which I don't want the detail comp todo.
Route map looks like below. SongList
is the list comp and Learderboard
is the detail comp
router.map({
'/': {
component: Home
},
'/songs': {
component: SongList
},
'/leaderboard/:songId': {
component: Leaderboard
}
})