Answer the question
In order to leave comments, you need to log in
Navigating through child pages?
Hello. I can't quite get my head around vue-router.
I have a page (there is more than one), on each page there is a table with the nth number of rows, and on each row there is a button to go to the information card for this very row.
So the question is, how do I correctly register routers to go to these pages?
{
path: '',
component: Hello,
meta: {}
},
{
path: 'Anketa_tp',
component: Anketa_tp,
meta: {}
},
{
path: 'banks',
component: Banks,
meta: {}
},
{
path: 'Anketa_tp/:id',
component: _id,
meta: {}
}
Answer the question
In order to leave comments, you need to log in
У меня так:
...
{path: '/templates', component: require('./components/Templates.vue')},
{path: '/templates/:id',
component: require('./components/Template.vue'),
props: true
},
...
export default {
name: 'template',
data: function () {
return {
///
};
},
props: [
'id'
],
watch: {
id: function() {
this.loadTemplate();
}
},
mounted: function () {
this.loadTemplate();
},
methods: {
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question