Skip to content
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

窗口变化后,happy-scroll-container的宽高没有响应 #11

Closed
cheaprYang opened this issue Jun 9, 2018 · 4 comments
Closed

窗口变化后,happy-scroll-container的宽高没有响应 #11

cheaprYang opened this issue Jun 9, 2018 · 4 comments

Comments

@cheaprYang
Copy link

在使用组件的时候,组件父级宽度改变了,但是happy-scroll-container的宽高没有随父级宽高响应,

@tangdaohai
Copy link
Owner

当前版本还不支持这个功能。 #2 #6

@cheaprYang
Copy link
Author

我已经解决了

@ColinCLL
Copy link

@cheaprYang 怎么解决的?

@tangdaohai
Copy link
Owner

tangdaohai commented Sep 20, 2018

@ColinCLL 目前版本可以自己监听父级窗口的 resize 事件,然后通过ref调用下mounted里面的方法:

this.setContainerSize()
this.$nextTick(() => {
this.getPercentage()
// 判断当前浏览器滚动条的模式,依据slot元素高度,如果高度大于视图高度,则出现滚动条了,此时再判断滚动条的模式
this.checkScrollMode()
// 获取当前浏览器滚动条的宽高
this.initBrowserSize()
})

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

No branches or pull requests

3 participants