mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-06 12:17:13 +08:00
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:
parent
ed269a064c
commit
9618615ad2
27
src/empty/demos/enUS/icon.demo.md
Normal file
27
src/empty/demos/enUS/icon.demo.md
Normal 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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
@ -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. |
|
||||||
|
11
src/empty/demos/enUS/size.demo.md
Normal file
11
src/empty/demos/enUS/size.demo.md
Normal 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>
|
||||||
|
```
|
27
src/empty/demos/zhCN/icon.demo.md
Normal file
27
src/empty/demos/zhCN/icon.demo.md
Normal 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
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
@ -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 | `()` | 自定义图标 |
|
||||||
|
11
src/empty/demos/zhCN/size.demo.md
Normal file
11
src/empty/demos/zhCN/size.demo.md
Normal 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>
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user