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

用 composition-api 开发的组件按需引入都报错 #696

Closed
cong-min opened this issue Apr 1, 2022 · 8 comments · Fixed by #702
Closed

用 composition-api 开发的组件按需引入都报错 #696

cong-min opened this issue Apr 1, 2022 · 8 comments · Fixed by #702
Assignees
Labels
🏃🏻 in progress someone is handling

Comments

@cong-min
Copy link
Contributor

cong-min commented Apr 1, 2022

tdesign-vue 版本

0.40.1

重现链接

Table: https://codesandbox.io/s/tdesign-vue-demo-forked-udg497?file=/src/demo.vue

Menu: https://codesandbox.io/s/tdesign-vue-demo-forked-j9bypt?file=/src/demo.vue

重现步骤

不通过 Vue.use 直接按需引入组件:

import { Table as TTable } from 'tdesign-vue';
export default {
  component: { TTable }
};

报错

wecom-temp-f3c3744ad3b3b5ac77bcccdf75b901d3

原因初步分析

业务没有安装@vue/composition-api 且没有执行 use 未触发 td 的自动安装,导致 setup 未执行,报错

期望结果

No response

实际结果

No response

框架版本

Vue2

浏览器版本

系统版本

Node版本

No response

补充说明

No response

@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2022

👋 @cong-min,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@github-actions
Copy link
Contributor

github-actions bot commented Apr 1, 2022

♥️ 有劳 @realyuyanan @chaishi @cool-518 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @cong-min

@uyarn
Copy link
Collaborator

uyarn commented Apr 1, 2022

升级到0.40+ 一下 已经fix了

@cong-min
Copy link
Contributor Author

cong-min commented Apr 1, 2022

@uyarn 不管用,看了逻辑0.40.1只解决了Vue.use(Table)的场景,没有调use依然不生效。
另外例子的依赖也升级到了0.40.1,同样的报错

@cong-min
Copy link
Contributor Author

cong-min commented Apr 1, 2022

初步分析是所有使用了 composition-api 开发的组件的共性问题,直接 import 按需引入会出问题,例如 Menu
https://codesandbox.io/s/tdesign-vue-demo-forked-j9bypt?file=/src/demo.vue

@cong-min cong-min changed the title [Table] 按需引入报错,缺少 composition-api 用 composition-api 的组件按需引入都报错 Apr 1, 2022
@cong-min cong-min changed the title 用 composition-api 的组件按需引入都报错 用 composition-api 开发的组件按需引入都报错 Apr 1, 2022
@LeeJim
Copy link
Collaborator

LeeJim commented Apr 1, 2022

我看看

@LeeJim LeeJim mentioned this issue Apr 1, 2022
6 tasks
@chaishi chaishi added the 🏃🏻 in progress someone is handling label Apr 3, 2022
@xiaosansiji
Copy link
Collaborator

已在 0.40.3 版本中修复 cong 试一下

@Hsomething
Copy link

这个问题解决了吗,0.47.0版本的也会出现这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏃🏻 in progress someone is handling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants