Vue-routerで動的なリンクを生成する方法をメモ
ルーティング
{
path:"/test/:id"
name:"test",
component:test
}
パラメーターの取得
test.vue
methods:{
test:function(){
alert(this.$route.params["test"]
}
}
router-link
test.vue
<router-link :to="{name:'test',params:{test:'test'}">リンク</router-link>