docs(components): [icon] (#10681)

* Adjust API style
This commit is contained in:
Xc 2022-11-21 20:44:50 +08:00 committed by GitHub
parent c32e55f9fb
commit f88d46e231
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 9 deletions

View File

@ -212,15 +212,17 @@ import { Edit, Share, Delete, Search, Loading } from '@element-plus/icons-vue'
<IconList />
## Icon Attributes
## API
| Name | Description | Type | Default |
| ------- | -------------------------- | ------------------------------ | ---------------------- |
| `color` | SVG tag's fill attribute | `Pick<CSSProperties, 'color'>` | inherit from color |
| `size` | SVG icon size, size x size | `number \| string` | inherit from font size |
### Attributes
## Icon Slots
| Name | Description | Type | Default |
| ----- | -------------------------- | --------------------- | ---------------------- |
| color | SVG tag's fill attribute | ^[string] | inherit from color |
| size | SVG icon size, size x size | ^[number] / ^[string] | inherit from font size |
| Name | Description |
| --------- | ------------------------- |
| `default` | customize default content |
### Slots
| Name | Description |
| ------- | ------------------------- |
| default | customize default content |

View File

@ -3,9 +3,15 @@ import type { ExtractPropTypes } from 'vue'
import type Icon from './icon.vue'
export const iconProps = buildProps({
/**
* @description SVG icon size, size x size
*/
size: {
type: definePropType<number | string>([Number, String]),
},
/**
* @description SVG tag's fill attribute
*/
color: {
type: String,
},