{
path: '/market/confirmPassword',
name: 'confirmPassword',
component: confirmPassword,
}
let value = {
accountType:3
}
const {
accountType } = value
1.query
this.$router.push({
path: "/market/confirmPassword",
//name: "confirmPassword",
query: {
accountType,
},
});
this.$route.query.accountType;
2.params
this.$router.push({
name: "confirmPassword",
params: {
accountType,
},
});
this.$route.params.accountType;
1.params只能由name引入路由,query都可以
2.query相当于get请求,页面跳转的时候,可以在地址栏看到请求参数,而params相当于post请求,参数不会在地址栏中显示