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

[Feature Request] 封装 Icon 组件后,也能正常检测到本地图标 #12649

Open
haohaio opened this issue Aug 17, 2024 · 0 comments
Open

Comments

@haohaio
Copy link

haohaio commented Aug 17, 2024

Background

想要像字体图标一样使用 Icon, 故对 Icon 组件进行了封装,但会导致无法检测到本地图标

import type { ComponentProps } from 'react';
import { Icon } from 'umi';

const MyIcon: React.FC<ComponentProps<typeof Icon>> = (props) => {
  return <Icon width="1em" height="1em" fill="currentColor" {...props} />;
};

export default MyIcon;
<MyIcon icon="local:home" className="text-[12px] text-[red]" />

Proposal

封装了 Icon 组件后,也能正常检测到本地图标。或者支持 icons: { include: ['local:*'] } 这样的配置...

@haohaio haohaio changed the title [Feature Request] say something [Feature Request] 封装 Icon 组件后,也能正常检测到本地图标 Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants