(1) 设置好路由配置
router.map({
‘/history/:deviceId/:dataId‘: {
name: ‘history‘, // give the route a name
component: { ... }
}
})
<a v-link="{ name: ‘history‘, params: { deviceId: 123, dataId:456 }}">history</a>
data: function() {
return {
deviceId:123,
dataId:456
}
}
<a v-link="{ name: ‘history‘, params: { deviceId: deviceId, dataId: dataId }}">history</a>
ready: function(){
console.log(‘deviceid: ‘ + this.$route.params.deviceId);
console.log(‘dataId: ‘ + this.$route.params.dataId);
}
原文链接:http://www.bubuko.com/infodetail-2227472.html
原文:http://www.cnblogs.com/karila/p/7520245.html