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

iconSetter设置了以后不进行自动import吗 #148

Open
liyzy opened this issue May 10, 2024 · 6 comments
Open

iconSetter设置了以后不进行自动import吗 #148

liyzy opened this issue May 10, 2024 · 6 comments

Comments

@liyzy
Copy link

liyzy commented May 10, 2024

iconSetter没有设置吗,用的expressionSetter,假如使用button组件,使用@ant-design/icons,添加了依赖以后,在icon中填写,但是源码中不会自动import { SearchOutlined } from '@ant-design/icons';

@liyzy
Copy link
Author

liyzy commented May 10, 2024

假如我在menuData中添加了RadioGroup,但会报错
image
image

@wwsun
Copy link
Contributor

wwsun commented May 10, 2024

组件包没有导出 RadioGroup 这个组件吧

@wwsun
Copy link
Contributor

wwsun commented May 10, 2024

iconSetter没有设置吗,用的expressionSetter,假如使用button组件,使用@ant-design/icons,添加了依赖以后,在icon中填写,但是源码中不会自动import { SearchOutlined } from '@ant-design/icons';

这个现在是 setter 的 onChange 逻辑里处理的。可以在 onChagne 的参数二里抛出 relatedImports 提供导入声明

onChange(option.render, { relatedImports: option.relatedImports });

@liyzy
Copy link
Author

liyzy commented May 11, 2024

iconSetter没有设置吗,用的expressionSetter,假如使用button组件,使用@ant-design/icons,添加了依赖以后,在icon中填写,但是源码中不会自动import { SearchOutlined } from '@ant-design/icons';

这个现在是 setter 的 onChange 逻辑里处理的。可以在 onChagne 的参数二里抛出 relatedImports 提供导入声明

onChange(option.render, { relatedImports: option.relatedImports });

但是relatedImports需要在组件属性配置中提前就声明好是吗,但是对于这种动态引入的,目前有可以自动导入吗

@liyzy
Copy link
Author

liyzy commented May 11, 2024

image
像div这种,导入的作用是什么呀,可以当做组件用吗

@wwsun
Copy link
Contributor

wwsun commented May 11, 2024

image 像div这种,导入的作用是什么呀,可以当做组件用吗

新版支持了选种 html 节点进行配置

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

No branches or pull requests

2 participants