// Note: This component in this body, there is this $ route and this $ router..
. // this $ route is designed to obtain the parameters of the route;
. // this $ router is designed to achieve programmatic navigation;
// Note:.. This $ route and this $ router two objects
// this. $ Route is a route parameter object, all routing parameters, params, query all belong to him
@ the Click = "goDesc"
methods: {
goDesc () {
. This $ router.push ( "path / home / goodsdesc /" + parameter this.goodsinfo.id);
}
}
2. Home tbar Jump ---
Tag jump <router-link class = "" to = "Path / home"> </ router-link>
We need to configure routing router.js
3. router.js China configure routing time attributes to the component definition name
props to receive routing parameters // Enable
{Path: 'path / home / goodscomment /: id', component: file name GoodsComment, props: true, name: 'name defined goodscmt'}
this.$router.push({
name: "goodscmt",
params: { id: this.goodsinfo.id }
});