pathnamecomponentView
http://localhost:8080/#/view/1
输出代码
let url = getServerUrl('/api/vue/food/findById');
axios.get(url, {params: {id: this.$route.params.id}}).then(response => {
console.log(response.data)
this.foodObj = response.data;
}).catch(error => {
alert(error);
})需要 路由配置
},{
path: '/type/:id',
name: 'Type',
component: Type
}console.log(this.q);
this.$router.replace('/search/result?q='+this.q);mounted() {
console.log(this.$route.query.q);
},不需要路由配置
,{
path: '/search/result',
name: 'SearchResult',
component: SearchResult
} 
站长微信:xiaomao0055
站长QQ:14496453