-
Notifications
You must be signed in to change notification settings - Fork 82
fix: 修复hook表格内路由跳转异常问题 && 删除文件夹目录docs/docks && 翻译部分Hook为中文 #115
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
base: master
Are you sure you want to change the base?
Conversation
| # useActionPending | ||
|
|
||
| 当你传递一个异步函数给这个hook时,它会返回一个封装后的函数和一个“异步进行中”数量。 | ||
| 当你传递一个异步函数给这个hook时,它会返回一个封装后的函数和一个"异步进行中"的数量。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在中文里,是不是应该用中文的双引号?
| ``` | ||
|
|
||
| 在返回的元组中,第二项称为`pendingCount`,你可以简单地用`!!pendingCount`来判断是否还有未完成的异步,并在界面上表现为一个“加载中”的视图。 | ||
| 在返回的元组中,第二项称为`pendingCount`,你可以简单地用`!!pendingCount`来判断是否还有未完成的异步,并在界面上表现为一个"加载中"的视图。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
|
|
||
| ```typescript | ||
| interface BooleanMethods { | ||
| // Change value to true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些注释,也翻译一下呗
|
|
||
| # useElementResize | ||
|
|
||
| 当元素调整大小时会触发一个回调函数。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的“一个”其实没必要写,看起来就特别生硬
| function useElementResize(callback: (element: HTMLElement) => void): ElementResizeCallback; | ||
| ``` | ||
|
|
||
| 为了确保所有改变的元素都能被捕获,甚至元素类型改变(从`<div>`标签修改为`<span>`标签), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确保React元素上的所有变化都能监听到,包括元素类型改变
| function useElementSize(): [ElementResizeCallback, Size | undefined]; | ||
| ``` | ||
|
|
||
| 初始值是`undefined` 当元素改变的时候会更新尺寸大小。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里好像多了个空格
|
|
||
| <code src='./demo/useHover.tsx'> | ||
|
|
||
| 注意, 当你给 `delay`参数传了个正数时,`onEnter` 和 `onLeave`的回调都是已经防抖过的, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里反而前面多了个空格,空格的规则保持一致吧,要加就都加,要么就都不加(我的习惯是不加)
| function useImmerState<S = any>(initialState: S | (() => S)): ImmerState<S>; | ||
| ``` | ||
|
|
||
| 这与`useState`的工作原理完全相同,唯一不同的是,当一个函数被传递给`setState`时,它可以直接改变状态。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的逗号都是半角的了
| function useImmerState<S = any>(initialState: S | (() => S)): ImmerState<S>; | ||
| ``` | ||
|
|
||
| 这与`useState`的工作原理完全相同,唯一不同的是,当一个函数被传递给`setState`时,它可以直接改变状态。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接改变状态 -> 可以直接修改当前的状态对象来更新状态值
| ``` | ||
|
|
||
| `useInfiniteScroll`中的`fetch`函数接收一个对象, 其中`offset`属性默认0, 表示下一页的起始索引。 | ||
| 如果你有一个函数需要`pageIndex`来工作,`offset / pageSize`都指向`pageIndex` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
都指向 -> 等于
1.修复hook表格内路由跳转异常问题,修改路由模式为browser
2.删除文件夹目录docs/docks, 改为平铺
3.翻译部分Hook为中文,useArray/useClickOutside/useBoolean