docs(snippet): add enum type of APIs

This commit is contained in:
unix
2020-06-24 21:01:23 +08:00
parent 90ad41a4dd
commit d2e5f19915
2 changed files with 24 additions and 1 deletions

View File

@@ -101,7 +101,7 @@ Display a snippet of copyable code for the command line.
| **copy** | function of copy button | `CopyTypes` | `'default', 'slient', 'prevent'` | `default` |
| **symbol** | symbol snippet | `string` | - | `$` |
| **toastText** | toast text | `string` | - | `Copied to clipboard!` |
| **toastType** | toast type | `NormalTypes` | `'default', 'secondary', 'success', 'warning', 'error'` | `success` |
| **toastType** | toast type | `NormalTypes` | [NormalTypes](#normaltypes) | `success` |
| ... | native props | `HTMLAttributes` | `'id', 'name', 'className', ...` | - |
<Attributes.Title>SnippetTypes</Attributes.Title>
@@ -116,6 +116,16 @@ type SnippetTypes = 'default'
| 'lite'
```
<Attributes.Title>NormalTypes</Attributes.Title>
```ts
type NormalTypes = 'default'
| 'secondary'
| 'success'
| 'warning'
| 'error'
```
</Attributes>
export default ({ children }) => <Layout meta={meta}>{children}</Layout>

View File

@@ -85,6 +85,9 @@ export const meta = {
| **filled** | 填充风格的样式 | `boolean` | - | `false` |
| **width** | 设置 CSS 宽度 | `string` | - | `initial` |
| **copy** | 拷贝按钮的工作方式 | `CopyTypes` | `'default', 'slient', 'prevent'` | `default` |
| **symbol** | 组件左侧显示的字符 | `string` | - | `$` |
| **toastText** | 拷贝提示的字符 | `string` | - | `Copied to clipboard!` |
| **toastType** | 拷贝提示的类型 | `NormalTypes` | [NormalTypes](#normaltypes) | `success` |
| ... | 原生属性 | `HTMLAttributes` | `'id', 'name', 'className', ...` | - |
<Attributes.Title>SnippetTypes</Attributes.Title>
@@ -99,6 +102,16 @@ type SnippetTypes = 'default'
| 'lite'
```
<Attributes.Title>NormalTypes</Attributes.Title>
```ts
type NormalTypes = 'default'
| 'secondary'
| 'success'
| 'warning'
| 'error'
```
</Attributes>
export default ({ children }) => <Layout meta={meta}>{children}</Layout>