refactor(description): clean code

This commit is contained in:
07akioni 2021-09-19 00:47:15 +08:00
parent 42477a21e6
commit 548552d798
3 changed files with 8 additions and 18 deletions

View File

@ -15,7 +15,7 @@ bordered
size
```
## Props
## API
### Descriptions Props
@ -30,7 +30,7 @@ size
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | Size of the description. |
| title | `string` | `undefined` | Title of the description. |
### Description Item Props
### DescriptionItem Props
| Name | Type | Default | Description |
| --- | --- | --- | --- |
@ -39,8 +39,6 @@ size
| label-style | `Object \| string` | `undefined` | Style of the item label. |
| span | `number` | `1` | Column span of the item. |
## Slots
### Descriptions Slots
| Name | Parameters | Description |
@ -48,7 +46,7 @@ size
| default | `()` | Content. |
| header | `()` | Header content. |
### Description Item Slots
### DescriptionItem Slots
| Name | Parameters | Description |
| ------- | ---------- | ------------- |

View File

@ -15,7 +15,7 @@ bordered
size
```
## Props
## API
### Descriptions Props
@ -30,7 +30,7 @@ size
| size | `'small' \| 'medium' \| 'large'` | `'medium'` | 尺寸 |
| title | `string` | `undefined` | 标题 |
### Description Item Props
### DescriptionItem Props
| 名称 | 类型 | 默认值 | 说明 |
| ------------- | ------------------ | ----------- | --------------- |
@ -39,8 +39,6 @@ size
| label-style | `Object \| string` | `undefined` | label 的样式 |
| span | `number` | `1` | 所占的单元格数 |
## Slots
### Descriptions Slots
| 名称 | 参数 | 说明 |
@ -48,7 +46,7 @@ size
| default | `()` | 描述的内容 |
| header | `()` | header 内容 |
### Description Item Slots
### DescriptionItem Slots
| 名称 | 参数 | 说明 |
| ------- | ---- | ------------------- |

View File

@ -29,10 +29,7 @@ const descriptionProps = {
type: Number,
default: 3
},
columns: {
type: Number,
default: undefined
},
columns: Number,
labelPlacement: {
type: String as PropType<'left' | 'top'>,
default: 'top'
@ -45,10 +42,7 @@ const descriptionProps = {
type: String as PropType<'small' | 'medium' | 'large'>,
default: 'medium'
},
bordered: {
type: Boolean,
default: false
},
bordered: Boolean,
labelStyle: [Object, String] as PropType<string | CSSProperties>,
contentStyle: [Object, String] as PropType<string | CSSProperties>
} as const