// this.$route.query的使用
// 1、传参数
this.$router.push({
path: '/index/detail',
query: { paramName: paramValue }
});
// 2、获取参数
this.$route.query.paramName
// 3、url的表现形式
http://localhost:8080/#/index/detail?paramName=paramValue
// this.$route.params的使用
// 1、传参数
this.$router.push({
name: 'detail', // path
params:{ paramName: paramValue } // 参数
});
// 2、获取参数
this.$route.params.paramName
// 3、url的表现形式(url中没带参数)
http://localhost:8080/#/index/detail
// 返回上一级
this.$router.go(-1) // 返回