-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: useMouse #147
feat: useMouse #147
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/umijs/hooks/5soscs0d4 |
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.
export from src/index.ts
?
src/useMouse/index_cn.mdx
Outdated
|
||
# useMouse | ||
|
||
一个跟踪鼠标位置的 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.
Hook 大写~
src/useSize/index.ts
Outdated
@@ -3,15 +3,15 @@ import ResizeObserver from 'resize-observer-polyfill'; | |||
|
|||
type Arg = HTMLElement | (() => HTMLElement) | null; | |||
|
|||
type Size = { width: number; height: number }; | |||
type Size = { width: number; height: number; top: number; left: number }; |
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.
我还是认为 useSize 加上 top 和 left 不太合适。 @awmleer
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.
我觉得加上也不是不可以,毕竟有的时候还是会用到 top
和 left
的。。(虽然语义上有点奇怪)
export from src/index.ts ? |
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.
LGTM
也许可以做一层性能上的优化,就是像 不过可能也不是很要紧。。 |
good idea,不过这个以后再做吧~~ |
No description provided.