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

[Dialog] 函数式调用方式使用dialog时,内部使用其他组件还需重新导入 #3521

Open
TanxiangCode opened this issue Oct 25, 2023 · 3 comments
Assignees
Labels

Comments

@TanxiangCode
Copy link

tdesign-vue-next 版本

1.6.5

重现链接

https://codesandbox.io/s/plugin-dialog-forked-ygdrgw?file=/src/Demo.vue

重现步骤

import Com from './xxxx.vue';

DialogPlugin.confirm({
header: opt.title,
body: (h) => h(Com),
closeOnOverlayClick: false,
destroyOnClose: true,
footer: false,
width: opt.width,
});

如上,假如在Com中再使用td的其他组件,则这些组件全部需要再通过import导入一次才可用。

期望结果

建议全局注册过的组件,在插件内渲染时不需要再此导入

实际结果

No response

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

♥️ 有劳 @LeeJim @caoML @vnues @huoyuhao 尽快确认问题。
确认有效后将下一步计划和可能需要的时间回复给 @TanxiangCode

@Zz-ZzzZ
Copy link
Contributor

Zz-ZzzZ commented Nov 24, 2023

由于全局导入组件是挂载到了app上,因此以函数式调用dialog时不会处理内部的组件

有些办法可以参考参考:

  1. 把全局引入组件删除,按照文档步骤使用unplugin-auto-importunplugin-vue-components
  2. 把函数式调用dialog挂载到app实例上使用getCurrentInstance调用

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

No branches or pull requests

4 participants