vue

Vue 传参

abdulla1992
2021-10-25 / 0 评论 / 158 阅读 / 正在检测是否收录...

1、打开新页签并传参

this.$router.push({
        path:'/model/model_detail',
        query: {id: modelId}
      })

2、新页面中接参

this.modelId = this.$route.query.id;

(注意:接参用this.$route 而不是 this.$router)

0

评论 (0)

取消