docs(empty): docs empty (#406)

* fix: export icon slot

* docs: add empty docs

* Apply suggestions from code review

* Update src/empty/demos/enUS/size.demo.md

Co-authored-by: 07akioni <07akioni2@gmail.com>

* Update src/empty/demos/zhCN/size.demo.md

Co-authored-by: 07akioni <07akioni2@gmail.com>

Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
caoyugang_1 2021-07-08 00:20:01 +08:00 committed by GitHub
parent ed269a064c
commit 9618615ad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 90 additions and 8 deletions

View File

@ -0,0 +1,27 @@
# Icon
Customize icon in empty.
```html
<n-empty description="Custom your icon">
<template #icon>
<n-icon>
<ios-airplane />
</n-icon>
</template>
<template #extra>
<n-button size="small">Find Something New</n-button>
</template>
</n-empty>
```
```js
import { IosAirplane } from '@vicons/ionicons4'
import { defineComponent } from 'vue'
export default defineComponent({
components: {
IosAirplane
}
})
```

View File

@ -6,19 +6,22 @@ E<span style="opacity: 0;">mpt</span>y.
```demo ```demo
basic basic
icon
size
``` ```
## Props ## Props
| Name | Type | Default | Description | | Name | Type | Default | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| description | `string` | `'No Data'` | | | description | `string` | `'No Data'` | Description of the empty. |
| show-description | `boolean` | `true` | | | show-description | `boolean` | `true` | Whether to show description of empty. |
| size | `'small' \| 'medium' \| 'large' \| 'huge'` | `'medium'` | | | size | `'small' \| 'medium' \| 'large' \| 'huge'` | `'medium'` | Empty's size. |
## Slots ## Slots
| Name | Parameters | Description | | Name | Parameters | Description |
| ------- | ---------- | ---------------------------- | | ------- | ---------- | ---------------------------- |
| default | `()` | In place of description prop | | default | `()` | In place of description prop |
| extra | `()` | | | extra | `()` | Extra content. |
| icon | `()` | Custom icon. |

View File

@ -0,0 +1,11 @@
# Size
Empty can be `small`, `medium`, `large` and `huge` size.
```html
<n-empty size="large" description="can be large">
<template #extra>
<n-button size="small">Find Something New</n-button>
</template>
</n-empty>
```

View File

@ -0,0 +1,27 @@
# 图标
自定义图标。
```html
<n-empty description="是一个飞机">
<template #icon>
<n-icon>
<ios-airplane />
</n-icon>
</template>
<template #extra>
<n-button size="small">看看别的</n-button>
</template>
</n-empty>
```
```js
import { IosAirplane } from '@vicons/ionicons4'
import { defineComponent } from 'vue'
export default defineComponent({
components: {
IosAirplane
}
})
```

View File

@ -6,19 +6,22 @@
```demo ```demo
basic basic
icon
size
``` ```
## Props ## Props
| 名称 | 类型 | 默认值 | 说明 | | 名称 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| description | `string` | `'无数据'` | | | description | `string` | `'无数据'` | 描述信息 |
| show-description | `boolean` | `true` | | | show-description | `boolean` | `true` | 是否展示描述信息 |
| size | `'small' \| 'medium' \| 'large' \| 'huge'` | `'medium'` | | | size | `'small' \| 'medium' \| 'large' \| 'huge'` | `'medium'` | 尺寸大小 |
## Slots ## Slots
| 名称 | 参数 | 说明 | | 名称 | 参数 | 说明 |
| ------- | ---- | ---------------- | | ------- | ---- | ---------------- |
| default | `()` | 代替 description | | default | `()` | 代替 description |
| extra | `()` | | | extra | `()` | 扩展的内容 |
| icon | `()` | 自定义图标 |

View File

@ -0,0 +1,11 @@
# 尺寸
`small`、`medium`、`large` 和 `huge` 尺寸。
```html
<n-empty size="large" description="可以是大的">
<template #extra>
<n-button size="small">看看别的</n-button>
</template>
</n-empty>
```