1. router-link
<router-link :to="{ path: ‘yourPath‘, params: { name: ‘name‘, dataObj: data }, query: { name: ‘name‘, dataObj: data } }"> </router-link>
2. $router方式跳转
this.$router.push({ path: ‘yourPath‘, query: { name: ‘name‘, dataObj: this.msg } })
this.$router.push(‘yourPath?code=123‘)
以上两种获取方式一样 ,this.$router.query.参数名
this.$router.push({ name: ‘yourName‘, params: { name: ‘name‘, dataObj: this.msg } })
获取:this.$router.params.参数名
原文地址:https://www.cnblogs.com/langqq/p/9807299.html
时间: 2024-10-10 04:13:56