Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat add provide inject #1692

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

wangshunnn
Copy link
Collaborator

Feature

  • Mpx 输出 小程序Web 支持 provide/inject 功能,支持选项式/组合式用法,具体使用和功能与 Vue2 对齐。

    • 小程序:核心实现思路是,顶层 provide 挂载在全局 App scope,组件层 provide 挂载在所属页面 scope。由于小程序原生限制,无法获取真实渲染时的父组件引用关系,所以不能像 Vue 那样基于父组件 provide 原型继承来实现。

    • Web:提供 Vue2 原生 provide/inject API,顶层 createApp provde 在创建 Vue App 实例时注入。(packages/webpack-plugin/lib/runtime/optionProcessor.js

TODO

  • 补充 Mpx 官网文档
  • 输出 RN 支持

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant