aliyun / alibabacloud-alfa

阿里云微前端解决方案
https://aliyun.github.io/alibabacloud-alfa
MIT License
850 stars 83 forks source link

vue子应用如何接受props? #58

Closed amsterdam-littlehill closed 3 years ago

amsterdam-littlehill commented 3 years ago

目前文档上缺少参数,且Mount中无法传入props从而获取宿主应用的参数

Boelroy commented 3 years ago

可以通过 在 render 方法中 通过 this.appProps 拿到 宿主传递下来的props

export default mount({
  el: '#app',
  data: {
    test: 1
  },
  router,
  render(h) {
    console.log('context', this.appProps)
    return h(App)
  }
})