mirror of
https://github.com/zhigang1992/react.git
synced 2026-02-12 22:29:35 +08:00
docs(snippet): add enum type of APIs
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user