fix: 修复hook表格内路由跳转异常问题 && 删除文件夹目录docs/docks && 翻译部分Hook为中文#115
Open
LaughSun0513 wants to merge 4 commits intoecomfe:masterfrom
Open
fix: 修复hook表格内路由跳转异常问题 && 删除文件夹目录docs/docks && 翻译部分Hook为中文#115LaughSun0513 wants to merge 4 commits intoecomfe:masterfrom
LaughSun0513 wants to merge 4 commits intoecomfe:masterfrom
Conversation
otakustay
requested changes
Nov 7, 2022
| # useActionPending | ||
|
|
||
| 当你传递一个异步函数给这个hook时,它会返回一个封装后的函数和一个“异步进行中”数量。 | ||
| 当你传递一个异步函数给这个hook时,它会返回一个封装后的函数和一个"异步进行中"的数量。 |
| ``` | ||
|
|
||
| 在返回的元组中,第二项称为`pendingCount`,你可以简单地用`!!pendingCount`来判断是否还有未完成的异步,并在界面上表现为一个“加载中”的视图。 | ||
| 在返回的元组中,第二项称为`pendingCount`,你可以简单地用`!!pendingCount`来判断是否还有未完成的异步,并在界面上表现为一个"加载中"的视图。 |
|
|
||
| ```typescript | ||
| interface BooleanMethods { | ||
| // Change value to true |
otakustay
requested changes
Nov 22, 2022
|
|
||
| # useElementResize | ||
|
|
||
| 当元素调整大小时会触发一个回调函数。 |
| function useElementResize(callback: (element: HTMLElement) => void): ElementResizeCallback; | ||
| ``` | ||
|
|
||
| 为了确保所有改变的元素都能被捕获,甚至元素类型改变(从`<div>`标签修改为`<span>`标签), |
Member
There was a problem hiding this comment.
确保React元素上的所有变化都能监听到,包括元素类型改变
| function useElementSize(): [ElementResizeCallback, Size | undefined]; | ||
| ``` | ||
|
|
||
| 初始值是`undefined` 当元素改变的时候会更新尺寸大小。 |
|
|
||
| <code src='./demo/useHover.tsx'> | ||
|
|
||
| 注意, 当你给 `delay`参数传了个正数时,`onEnter` 和 `onLeave`的回调都是已经防抖过的, |
Member
There was a problem hiding this comment.
这里反而前面多了个空格,空格的规则保持一致吧,要加就都加,要么就都不加(我的习惯是不加)
| function useImmerState<S = any>(initialState: S | (() => S)): ImmerState<S>; | ||
| ``` | ||
|
|
||
| 这与`useState`的工作原理完全相同,唯一不同的是,当一个函数被传递给`setState`时,它可以直接改变状态。 |
| function useImmerState<S = any>(initialState: S | (() => S)): ImmerState<S>; | ||
| ``` | ||
|
|
||
| 这与`useState`的工作原理完全相同,唯一不同的是,当一个函数被传递给`setState`时,它可以直接改变状态。 |
Member
There was a problem hiding this comment.
直接改变状态 -> 可以直接修改当前的状态对象来更新状态值
| ``` | ||
|
|
||
| `useInfiniteScroll`中的`fetch`函数接收一个对象, 其中`offset`属性默认0, 表示下一页的起始索引。 | ||
| 如果你有一个函数需要`pageIndex`来工作,`offset / pageSize`都指向`pageIndex` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1.修复hook表格内路由跳转异常问题,修改路由模式为browser
2.删除文件夹目录docs/docks, 改为平铺
3.翻译部分Hook为中文,useArray/useClickOutside/useBoolean