Vuelinksnip
Jump to navigation
Jump to search
// this is in the route.js file
{ path: 'user/:id', component: User},
---------------------
header has the link with the id
<router-link to="/user/10" tag="li" active-class="active"> <a>User1</a> </router-link>
---------------------------------------
// to get the id passed from the header file
<template>
<p>Loaded ID:{{id}}</p>
</template>
<script>
export default {
data(){
return{
id: this.$route.params.id
}
}
</script>