Skip to content

Commit

Permalink
docs(Button): 更新按钮点击事件类型
Browse files Browse the repository at this point in the history
  • Loading branch information
79E committed Dec 8, 2022
1 parent 40af2de commit 94d9470
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/guide/contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ color?: String;
* @desc 用户点击按钮后触发此方法
* @default ''
* @param event React.MouseEvent<HTMLButtonElement, MouseEvent>
* @return void | Promise<void>
* @return void
*/
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void>;
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
```

总结:就是让用户用的明明白白,一眼就知道怎么使用。
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import { Button } from "aunt";

| 事件名 | 说明 | 类型 | 默认值 |
| ------- | -------------- | ----------------------------------------------------------------------------------- | ------ |
| onClick | 点击图标时触发 | `(event:React.MouseEvent<HTMLButtonElement, MouseEvent>) => void \| Promise<void> ` | `-` |
| onClick | 点击图标时触发 | `(event:React.MouseEvent<HTMLButtonElement, MouseEvent>) => void ` | `-` |

## 样式变量

Expand Down
2 changes: 1 addition & 1 deletion src/components/button/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ export interface ButtonProps extends BaseTypeProps {
* @param event React.MouseEvent<HTMLButtonElement, MouseEvent>
* @return void | Promise<void>
*/
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void | Promise<void>;
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
}

0 comments on commit 94d9470

Please sign in to comment.