1.传递参数的页面 html中
<el-button type="primary" @click="toAdds">传参</el-button>
methods中:
toAdd() {
const a = '1'
this.$router.push({ path: '/route?a=' + a })
},
//a是需要传的值 route是跳转的路由地址
2.接受参数的页面
在beforeMount里再赋值
this.formData.a = this.$route.query?.a || '1'