Skip to content

暴露 icon 组件的内置 type 数组 #1769

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

Closed
1 task done
EmiyaYang opened this issue Feb 11, 2020 · 2 comments
Closed
1 task done

暴露 icon 组件的内置 type 数组 #1769

EmiyaYang opened this issue Feb 11, 2020 · 2 comments
Labels

Comments

@EmiyaYang
Copy link

EmiyaYang commented Feb 11, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

暴露内置 iconTypeArr 数组, 便于开发者在使用自定义 SVG 图标时抹平 type 与 component 的差异.

import { iconTypeArr } from 'ant-design-vue'

function sample (type) {
    return iconTypeArr.includes(type) 
              ? <a-icon type={type} />
              : <a-icon component={type} />
}

What does the proposed API look like?

import { iconTypeArr } from 'ant-design-vue'
@sendya
Copy link
Member

sendya commented Feb 11, 2020

https://github.com/ant-design/ant-design-icons/tree/master/packages/icons-vue/src/icons

或者自己整理
https://github.com/sendya/ant-design-pro-vue/blob/master/src/components/IconSelector/icons.js

import * as allIcons from '@ant-design/icons/lib/dist';

Object.keys(allIcons).includes(type) 

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants