this.$router.push({
name: 'A',
query: {
id: 1,
name: 'a',
}
});
this.$router.push({
name: 'B',
params: {
id: 1,
name: 'b',
}
});
Except for the different address? What's the difference? I feel like these two have the same effect.
When to use query and when to use params? Or are they basically the same?
/data/:id
这个路由匹配/data/1
,/data/2
The id here is called params/data?id=1
/data?id=2
The id here is called query