Skip to content

Ant Design new feature: use SVG Icon #143

@HeskeyBaozi

Description

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

What problem does this feature solve?

This feature is in the feature and can preview in antd@next.

See ant-design/ant-design-icons#3

we need a Vue component that resolve the svg abstract tree and render the svg icon.

The React version: https://github.com/ant-design/ant-design-icons/tree/dev/packages/icons-react

What does the proposed API look like?

import { AntDesignOutline, DashboardOutline, TwitterOutline } from '@ant-design/icons';
import AntdIcon from '@ant-design/icons-vue'; // or other package names.
AntdIcon.add(AntDesignOutline, DashboardOutline); // or use other static methods
Vue.use(AntdIcon); // or Vue.component('antd-icon', AntdIcon);

After that, you can use antd icons in your Vue components as simply as this:

<antd-icon type="ant-design-o"></antd-icon>
<antd-icon type="dashboard-o"></antd-icon>
<antd-icon :type="TwitterOutline"></antd-icon>

That's APIs are just for demo.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions