Skip to content

增加浏览器宽高的监听 #50

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

增加浏览器宽高的监听 #50

wants to merge 1 commit into from

Conversation

mablevi
Copy link

@mablevi mablevi commented Apr 28, 2021

增加了一个作用于页面最外部的scroll, 可以监听外部浏览器宽高的变化

@tangdaohai
Copy link
Owner

#49

@tangdaohai
Copy link
Owner

@mablevi 增加对浏览器窗口 resize 监听的目的是什么?

@mablevi
Copy link
Author

mablevi commented Apr 28, 2021

@tangdaohai
做一个大屏的项目,屏幕宽度大概是1920*2 。这样在正常的电脑屏幕上是需要滚动条的。拖拽浏览器的时候就需要外部也跟着滚动适配。就像浏览器的滚动条一样。
我已经用您的这个组件,实现了上述的功能。
但是在大屏的页面里面又嵌套了一个自定义弹出层的时候也加了一个scroll,里面的容器获取到的宽高为什么是20px。

@tangdaohai
Copy link
Owner

tangdaohai commented May 10, 2021

做一个大屏的项目,屏幕宽度大概是1920*2 。这样在正常的电脑屏幕上是需要滚动条的。拖拽浏览器的时候就需要外部也跟着滚动适配。就像浏览器的滚动条一样。

谢谢提交的 PR,我这块计划是提供一个 方法,支持外部调用,触发 resize 的时机交给使用者去控制

但是在大屏的页面里面又嵌套了一个自定义弹出层的时候也加了一个scroll,里面的容器获取到的宽高为什么是20px。

没有理解到问题具体的情况,建议开个 issue 讨论一下

@mablevi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants