vue跳转页面传值怎么传?

时间:2023-03-09 20:31:39
vue跳转页面传值怎么传?

这是路由跳转:

this.$router.push( { name: 'holderResult', params: { meetingId:self.$route.params.meetingId},query: { flag:true} } );

无query,例如:http://localhost:8088/#/voting/pt/11111111111

例如:http://localhost:8088/#/voteContent/pt/11111111111?flag=true

query就是自定义传值

params就是需要路由配置

的路由配置是:

import holderResult from '../../views/holderResult/holderResult.vue';
const voteRoute = [
{
path: "/voteContent/pt/:meetingId",
name: "holderResult",
components: {
default: holderResult,
},
meta:{
permissions:['fvote:tp:sj']
}
}
];
export default voteRoute;