Skip to content

Commit

Permalink
Merge branch 'master' of ssh://github.com/potato4d/vue-fixed-header
Browse files Browse the repository at this point in the history
  • Loading branch information
potato4d committed Nov 6, 2019
2 parents 2bc109b + 09d3e2e commit e81d57d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/components/ExampleApp.vue
Expand Up @@ -15,9 +15,12 @@
</el-menu>
</nav>
</VueFixedHeader>
<div class="container" :class="{
headerIsFixed: fixedStatus.headerIsFixed
}">
<div
class="container"
:class="{
headerIsFixed: fixedStatus.headerIsFixed
}"
>
<el-card>
<h3 class="heading">
vue-fixed-header debugging
Expand Down
7 changes: 5 additions & 2 deletions src/components/vue-fixed-header.tsx
Expand Up @@ -52,8 +52,11 @@ export default Vue.extend({
this.check = () => {
const { threshold, hideScrollUp } = this
let currentScrollPos = this.getScrollTop()
this.isFixed = (currentScrollPos >= this.lastScrollTop) ? currentScrollPos > threshold : !hideScrollUp
this.lastScrollTop = currentScrollPos;
this.isFixed =
currentScrollPos >= this.lastScrollTop
? currentScrollPos > threshold
: !hideScrollUp
this.lastScrollTop = currentScrollPos
this.$emit('change', this.isFixed)
this.$forceUpdate()
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -1676,10 +1676,10 @@
version "20.0.1"
resolved "https://registry.yarnpkg.com/@types/jest-diff/-/jest-diff-20.0.1.tgz#35cc15b9c4f30a18ef21852e255fdb02f6d59b89"

"@types/jest@24.0.21":
version "24.0.21"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.21.tgz#2c0a25440e025bb265f4a17d8b79b11b231426bf"
integrity sha512-uyqFvx78Tuy0h5iLCPWRCvi5HhWwEqhIj30doitp191oYLqlCxUyAJHdWVm5+Nr271/vPnkyt6rWeEIjGowBTg==
"@types/jest@24.0.22":
version "24.0.22"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.0.22.tgz#08a50be08e78aba850a1185626e71d31e2336145"
integrity sha512-t2OvhNZnrNjlzi2i0/cxbLVM59WN15I2r1Qtb7wDv28PnV9IzrPtagFRey/S9ezdLD0zyh1XGMQIEQND2YEfrw==
dependencies:
"@types/jest-diff" "*"

Expand Down

0 comments on commit e81d57d

Please sign in to comment.