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

fix(utils): 判断_installedPlugins条件修正 #1697

Merged
merged 3 commits into from
Nov 2, 2022

Conversation

qqw78901
Copy link
Contributor

@qqw78901 qqw78901 commented Oct 28, 2022

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

💡 需求背景和解决方案

  1. 【关键】在没使用任何插件前,Vue._installedPlugins为undefined
  2. 单组件,在withInstall中会自动注册composition-api,而且该时机是在组件被import时立即执行
  3. 只要出现 未注册任何组件的情况下,但组件被import,而全局没引入composition-api(事实上,基于第2点,可以不按文档所说地全局引入composition-api的),则报错TypeError: this.renderSelectSingle is not a function

解决:

修正该判断,Vue._installedPluginsundefined也安装composition-api

修复后效果

image

📝 更新日志

  • fix: 支持局部注册组件不再需要手动引入 Composition-API

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2022

完成

@uyarn
Copy link
Collaborator

uyarn commented Nov 2, 2022

事实上,基于第2点,可以不按文档所说地全局引入composition-api的 这里指的是文档的哪部分?

@qqw78901
Copy link
Contributor Author

qqw78901 commented Nov 2, 2022

事实上,基于第2点,可以不按文档所说地全局引入composition-api的 这里指的是文档的哪部分?

“ 由于部分组件依赖了@vue/composition-api,在以上配置之外,自动引入的方式仍需要您手动引入@vue/composition-api来保证组件的正常运行。”

确实没提到局部注册组件需要全局import composition-api, 只是自动注册。

Copy link
Collaborator

@LeeJim LeeJim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@uyarn uyarn merged commit 538f732 into Tencent:develop Nov 2, 2022
@github-actions github-actions bot mentioned this pull request Nov 2, 2022
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.

3 participants