I'm trying to show a list of items and an item detail on the same page. When one clicks on an item in the list, that item is shown in the detail view and the url should change to /items/item_id
This is how I do it now, but of course the url doesn't change:
<div>
<items-table :items="items" @OnItemClicked="selectedItem=$event"></items-table>
</div>
<div v-if="selectedItem">
<item-detail :item="selectedItem"></contact-card>
</div>
I tried changing the url by doing router.push(...) when one clicks on an item in the list, but this reloads the whole page.
I've also looked for a nested router-view, but I'm not sure if that is the correct way or how to implement that.
What is the best way in vue.js to show a list of items and an item detail on the same page?