Skip to content

Commit 087ca90

Browse files
committed
Build docs
1 parent 4c2e74f commit 087ca90

13 files changed

+202
-20
lines changed

docs/css/app.06403b8e.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/css/app.07c3cf9a.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/css/page-mode.bb1117ff.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><title>vue-virtual-scroll-list</title><link rel=icon href=favicon.png><link rel=stylesheet href=milligram.css><link rel=stylesheet href=highlight/theme.css><script src=highlight/pack.js></script><script async defer src=https://buttons.github.io/buttons.js></script><script>hljs.initHighlightingOnLoad()</script><link href=css/chat-room.ebb0f527.css rel=prefetch><link href=css/dynamic-size.9013d8ce.css rel=prefetch><link href=css/fixed-size.840ec49f.css rel=prefetch><link href=css/horizontal.50e26ffa.css rel=prefetch><link href=css/infinite-loading.4b238c18.css rel=prefetch><link href=css/keep-state.ad1b8c2c.css rel=prefetch><link href=js/chat-room.7e2eee47.js rel=prefetch><link href=js/chat-room~dynamic-size~fixed-size~horizontal~infinite-loading~keep-state.2e7deb58.js rel=prefetch><link href=js/dynamic-size.debe7fb6.js rel=prefetch><link href=js/fixed-size.fab2dd0f.js rel=prefetch><link href=js/horizontal.6faaaf18.js rel=prefetch><link href=js/infinite-loading.afbe430b.js rel=prefetch><link href=js/keep-state.d5fcfbd1.js rel=prefetch><link href=css/app.07c3cf9a.css rel=preload as=style><link href=js/app.6c3d8407.js rel=preload as=script><link href=js/chunk-vendors.01cce721.js rel=preload as=script><link href=css/app.07c3cf9a.css rel=stylesheet></head><body><div id=app></div><script src=js/chunk-vendors.01cce721.js></script><script src=js/app.6c3d8407.js></script></body></html>
1+
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><title>vue-virtual-scroll-list</title><link rel=icon href=favicon.png><link rel=stylesheet href=milligram.css><link rel=stylesheet href=highlight/theme.css><script src=highlight/pack.js></script><script async defer src=https://buttons.github.io/buttons.js></script><script>hljs.initHighlightingOnLoad()</script><link href=css/chat-room.ebb0f527.css rel=prefetch><link href=css/dynamic-size.9013d8ce.css rel=prefetch><link href=css/fixed-size.840ec49f.css rel=prefetch><link href=css/horizontal.50e26ffa.css rel=prefetch><link href=css/infinite-loading.4b238c18.css rel=prefetch><link href=css/keep-state.ad1b8c2c.css rel=prefetch><link href=css/page-mode.bb1117ff.css rel=prefetch><link href=js/chat-room.7e2eee47.js rel=prefetch><link href=js/chat-room~dynamic-size~fixed-size~horizontal~infinite-loading~keep-state~page-mode.080dff91.js rel=prefetch><link href=js/dynamic-size.debe7fb6.js rel=prefetch><link href=js/fixed-size.fab2dd0f.js rel=prefetch><link href=js/horizontal.6faaaf18.js rel=prefetch><link href=js/infinite-loading.afbe430b.js rel=prefetch><link href=js/keep-state.d5fcfbd1.js rel=prefetch><link href=js/page-mode.ff8e6c9b.js rel=prefetch><link href=css/app.06403b8e.css rel=preload as=style><link href=js/app.ee725312.js rel=preload as=script><link href=js/chunk-vendors.01cce721.js rel=preload as=script><link href=css/app.06403b8e.css rel=stylesheet></head><body><div id=app></div><script src=js/chunk-vendors.01cce721.js></script><script src=js/app.ee725312.js></script></body></html>

docs/index.js

Lines changed: 50 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-scroll-list v2.1.6
2+
* vue-virtual-scroll-list v2.1.7
33
* open source under the MIT license
44
* https://github.com/tangbc/vue-virtual-scroll-list#readme
55
*/
@@ -113,7 +113,7 @@
113113
}, {
114114
key: "getOffset",
115115
value: function getOffset(start) {
116-
return start < 1 ? 0 : this.getIndexOffset(start);
116+
return (start < 1 ? 0 : this.getIndexOffset(start)) + this.param.slotHeaderSize;
117117
}
118118
}, {
119119
key: "updateParam",
@@ -407,6 +407,10 @@
407407
type: Number,
408408
"default": 0
409409
},
410+
pageMode: {
411+
type: Boolean,
412+
"default": false
413+
},
410414
rootTag: {
411415
type: String,
412416
"default": 'div'
@@ -626,6 +630,19 @@
626630
this.scrollToIndex(this.start);
627631
} else if (this.offset) {
628632
this.scrollToOffset(this.offset);
633+
} // in page mode we bind scroll event to document
634+
635+
636+
if (this.pageMode) {
637+
document.addEventListener('scroll', this.onScroll, {
638+
passive: false
639+
}); // taking root offsetTop or offsetLeft as slot header size
640+
641+
var root = this.$refs.root;
642+
643+
if (root) {
644+
this.virtual.updateParam('slotHeaderSize', root[this.isHorizontal ? 'offsetLeft' : 'offsetTop']);
645+
}
629646
}
630647
},
631648
beforeDestroy: function beforeDestroy() {
@@ -642,25 +659,45 @@
642659
},
643660
// return current scroll offset
644661
getOffset: function getOffset() {
645-
var root = this.$refs.root;
646-
return root ? Math.ceil(root[this.directionKey]) : 0;
662+
if (this.pageMode) {
663+
return document.documentElement[this.directionKey];
664+
} else {
665+
var root = this.$refs.root;
666+
return root ? Math.ceil(root[this.directionKey]) : 0;
667+
}
647668
},
648669
// return client viewport size
649670
getClientSize: function getClientSize() {
650-
var root = this.$refs.root;
651-
return root ? root[this.isHorizontal ? 'clientWidth' : 'clientHeight'] : 0;
671+
var key = this.isHorizontal ? 'clientWidth' : 'clientHeight';
672+
673+
if (this.pageMode) {
674+
return document.documentElement[key];
675+
} else {
676+
var root = this.$refs.root;
677+
return root ? root[key] : 0;
678+
}
652679
},
653680
// return all scroll size
654681
getScrollSize: function getScrollSize() {
655-
var root = this.$refs.root;
656-
return root ? root[this.isHorizontal ? 'scrollWidth' : 'scrollHeight'] : 0;
682+
var key = this.isHorizontal ? 'scrollWidth' : 'scrollHeight';
683+
684+
if (this.pageMode) {
685+
return document.documentElement[key];
686+
} else {
687+
var root = this.$refs.root;
688+
return root ? root[key] : 0;
689+
}
657690
},
658691
// set current scroll position to a expectant offset
659692
scrollToOffset: function scrollToOffset(offset) {
660-
var root = this.$refs.root;
693+
if (this.pageMode) {
694+
document.documentElement[this.directionKey] = offset;
695+
} else {
696+
var root = this.$refs.root;
661697

662-
if (root) {
663-
root[this.directionKey] = offset || 0;
698+
if (root) {
699+
root[this.directionKey] = offset;
700+
}
664701
}
665702
},
666703
// set current scroll position to a expectant index
@@ -819,6 +856,7 @@
819856
padFront = _this$range2.padFront,
820857
padBehind = _this$range2.padBehind;
821858
var isHorizontal = this.isHorizontal,
859+
pageMode = this.pageMode,
822860
rootTag = this.rootTag,
823861
wrapTag = this.wrapTag,
824862
wrapClass = this.wrapClass,
@@ -836,7 +874,7 @@
836874
return h(rootTag, {
837875
ref: 'root',
838876
on: {
839-
'&scroll': this.onScroll
877+
'&scroll': !pageMode && this.onScroll
840878
}
841879
}, [// header slot
842880
header ? h(Slot, {

docs/js/app.6c3d8407.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

docs/js/app.ee725312.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)