I'm trying to pass a querystring value when I open a view. I have set up my router like this:
import Home from "../views/Home.vue";
import Summary from "../views/Summary.vue";
Vue.use(VueRouter);
const routes = [
{
path: "/",
name: "home",
component: Home
},
{
path: "/summary/:id",
name: "Summary",
component: Summary
}
];
The home.vue has this link:
<a href="#" class="card-link" @click.prevent="goSummary(item.id)">View Item Summary</a> <!--item.id came from the v-for loop-->
The home.vue has this on the export default script
methods: {
goSummary(id) {
//do other things here
this.$router.replace('Summary/'+id); //I'm supposed to see the view
}
}