wip
This commit is contained in:
parent
e28d1c7569
commit
dfa2c951d6
7 changed files with 72 additions and 23 deletions
|
|
@ -73,16 +73,20 @@ export default Vue.extend({
|
|||
}
|
||||
},
|
||||
|
||||
inject: ['getColumn', 'getScrollContainer'],
|
||||
|
||||
created() {
|
||||
this.getColumn().$once('mounted', () => {
|
||||
this.rootEl = this.getScrollContainer();
|
||||
this.rootEl.addEventListener('scroll', this.onScroll);
|
||||
})
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.root.removeEventListener('scroll', this.onScroll);
|
||||
this.rootEl.removeEventListener('scroll', this.onScroll);
|
||||
},
|
||||
|
||||
methods: {
|
||||
mount(root) {
|
||||
this.rootEl = root;
|
||||
this.rootEl.addEventListener('scroll', this.onScroll);
|
||||
},
|
||||
|
||||
isScrollTop() {
|
||||
if (this.rootEl == null) return true;
|
||||
return this.rootEl.scrollTop <= 8;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue