Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: useClickAway文档描述修改 Target 属性支持函数 #2680

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions packages/hooks/src/useClickAway/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ useClickAway<T extends Event = Event>(

### Params

| Property | Description | Type | Default |
| ----------- | ------------------------------------------- | ------------------------------------------ | ------- |
| onClickAway | Trigger Function | `(event: T) => void` | - |
| target | DOM elements or Ref, support array | `Target` \| `Target[]` | - |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用加函数,只需要在类型里增加 () => (() => Element) ,参考一下这个 hook 的文档

| eventName | Set the event to be listened, support array | `DocumentEventKey` \| `DocumentEventKey[]` | `click` |
| Property | Description | Type | Default |
| ----------- | ---------------------------------------------- | ------------------------------------------ | ------- |
| onClickAway | Trigger Function | `(event: T) => void` | - |
| target | DOM elements or Ref or Function, support array | `Target` \| `Target[]` | - |
| eventName | Set the event to be listened, support array | `DocumentEventKey` \| `DocumentEventKey[]` | `click` |
10 changes: 5 additions & 5 deletions packages/hooks/src/useClickAway/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ useClickAway<T extends Event = Event>(

### Params

| 参数 | 说明 | 类型 | 默认值 |
| ----------- | ---------------------------- | ------------------------------------------ | ------- |
| onClickAway | 触发函数 | `(event: T) => void` | - |
| target | DOM 节点或者 Ref,支持数组 | `Target` \| `Target[]` | - |
| eventName | 指定需要监听的事件,支持数组 | `DocumentEventKey` \| `DocumentEventKey[]` | `click` |
| 参数 | 说明 | 类型 | 默认值 |
| ----------- | ----------------------------------- | ------------------------------------------ | ------- |
| onClickAway | 触发函数 | `(event: T) => void` | - |
| target | DOM 节点或者 Ref 或者函数,支持数组 | `Target` \| `Target[]` | - |
| eventName | 指定需要监听的事件,支持数组 | `DocumentEventKey` \| `DocumentEventKey[]` | `click` |