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

Sticky bug 修复建议 #2123

Open
puregardenia opened this issue Oct 26, 2017 · 4 comments
Open

Sticky bug 修复建议 #2123

puregardenia opened this issue Oct 26, 2017 · 4 comments

Comments

@puregardenia
Copy link

puregardenia commented Oct 26, 2017

if (distance >= navOffsetY) {

当 offset 为 0时,从路由跳转过来,会默认加上 .vux-fixed 样式,但是当前页面刷新的时候却不会加上这个样式,样式不统一,前端显示会有问题!
建议改为 if (distance > navOffsetY) { ,可以解决我现在碰到的问题

@puregardenia
Copy link
Author

@airyland

@puregardenia puregardenia changed the title Sticky bug 修复 Sticky bug 修复建议 Oct 26, 2017
@airyland
Copy link
Owner

没看大明白,试试在代码 mounted 处调用下 sticky 组件的 bindSticky 方法呢?

@puregardenia
Copy link
Author

puregardenia commented Oct 26, 2017

mounted 里面手动调用 组件的 bindSticky 方法也不行

<sticky ref="sticky">
...
</sticky>

mounted() {
      ...
      this.$refs.sticky.bindSticky()
}

Android 下测的是有问题的,ios 下没问题。主要还是刷新时,scrollHandle()不执行,从其他路由跳转进来的时候scrollHandler()会执行

chrome 调试工具 设备选 Nexus 6

image

但是改为 >, 滚动的时候样式会出现突变

@raolight
Copy link

一样问题,改成if (distance > navOffsetY) {问题解决了,感谢大佬~~

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