docs: add api for forwardRef

This commit is contained in:
unix
2020-05-21 16:56:38 +08:00
parent 30d5f80b04
commit 0955cd21ac
6 changed files with 12 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
import { Layout, Playground, Attributes } from 'lib/components'
import { Button, Spacer, Grid } from 'components'
import { Button, Spacer, Grid, Code } from 'components'
import Router from 'next/router'
import Settings from '@zeit-ui/react-icons/settings'
import UserX from '@zeit-ui/react-icons/userX'
@@ -125,10 +125,11 @@ Used to trigger an operation.
| **auto** | autoscale width | `boolean` | - | `false` |
| **effect** | display animation | `boolean` | - | `true` |
| **disabled** | disable button | `boolean` | - | `false` |
| **icon** | show icon in button | `ReactNode` | - | - |
| **htmlType** | native type of button element | `ButtonHTMLAttributes.type` | - | `button` |
| **iconRight** | show icon on the other side of the button | `ReactNode` | - | - |
| **onClick** | click handler | `MouseEventHandler` | - | - |
| **icon** | show icon in button | `ReactNode` | - | - |
| **iconRight** | show icon on the other side of the button | `ReactNode` | - | - |
| **htmlType** | native type of button element | `ButtonHTMLAttributes.type` | - | `button` |
| **ref** | forwardRef | <Code>Ref<HTMLButtonElement &#124; null></Code> | - | - |
| ... | native props | `ButtonHTMLAttributes` | `'id', 'className', ...` | - |
<Attributes.Title>ButtonTypes</Attributes.Title>

View File

@@ -191,6 +191,7 @@ Retrieve text input from a user.
| **onIconClick** | click icon event | `(e: React.ChangeEvent) => void` | - | - |
| **onChange** | change event | `(e: React.ChangeEvent) => void` | - | - |
| **onClearClick** | clear icon event | `(e: React.MouseEvent) => void` | - | - |
| **ref** | forwardRef | <Code>Ref<HTMLInputElement &#124; null></Code> | - | - |
| ... | native props | `InputHTMLAttributes` | `'alt', 'type', 'className', ...` | - |
<Attributes.Title>Input.Password.Props</Attributes.Title>

View File

@@ -79,6 +79,7 @@ Hyperlinks between pages.
| **icon** | show icon | `boolean` | - | `false` |
| **underline** | display underline | `boolean` | - | `false` |
| **block** | display as a separate block | `boolean` | - | `false` |
| **ref** | forwardRef | <Code>Ref<HTMLAnchorElement &#124; null></Code> | - | - |
| ... | native props | `AnchorHTMLAttributes` | `'rel', 'target', ...` | - |
</Attributes>

View File

@@ -1,5 +1,5 @@
import { Layout, Playground, Attributes } from 'lib/components'
import { Button, Spacer, Grid } from 'components'
import { Button, Spacer, Grid, Code } from 'components'
import Router from 'next/router'
import Settings from '@zeit-ui/react-icons/settings'
import UserX from '@zeit-ui/react-icons/userX'
@@ -129,6 +129,7 @@ export const meta = {
| **icon** | 在按钮内显示图标 | `ReactNode` | - | - |
| **iconRight** | 在按钮的另一侧显示图标 | `ReactNode` | - | - |
| **htmlType** | 按钮的原生类型属性 | `ButtonHTMLAttributes.type` | - | `button` |
| **ref** | 转发的原生按钮 Ref | <Code>Ref<HTMLButtonElement &#124; null></Code> | - | - |
| ... | 原生属性 | `ButtonHTMLAttributes` | `'id', 'className', ...` | - |
<Attributes.Title>ButtonTypes</Attributes.Title>

View File

@@ -192,7 +192,8 @@ export const meta = {
| **onIconClick** | 图标点击事件 | `(e: React.ChangeEvent) => void` | - | - |
| **onChange** | 输入框变化事件 | `(e: React.ChangeEvent) => void` | - | - |
| **onClearClick** | 清除按钮的点击事件 | `(e: React.MouseEvent) => void` | - | - |
| ... | 原生属性 | `InputHTMLAttributes` | `'alt', 'type', 'className', ...` | - |
| **ref** | 转发的原生输入框 Ref | <Code>Ref<HTMLInputElement &#124; null></Code> | - | - |
| ... | 原生属性 | `InputHTMLAttributes` | `'id', 'className', ...` | - |
<Attributes.Title>Input.Password.Props</Attributes.Title>

View File

@@ -79,6 +79,7 @@ export const meta = {
| **icon** | 在文本后显示图标 | `boolean` | - | `false` |
| **underline** | 显示下划线 | `boolean` | - | `false` |
| **block** | 是否以块的方式显示链接 | `boolean` | - | `false` |
| **ref** | 转发的原生链接 Ref | <Code>Ref<HTMLAnchorElement &#124; null></Code> | - | - |
| ... | 原生属性 | `AnchorHTMLAttributes` | `'rel', 'target', ...` | - |
</Attributes>