Skip to content

Commit 005c045

Browse files
committed
Merge branch 'master' into chat-app
2 parents 58afa0b + 2874403 commit 005c045

29 files changed

+117
-83
lines changed

dist/index.js

Lines changed: 49 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-virtual-scroll-list v2.0.9
2+
* vue-virtual-scroll-list v2.1.1
33
* open source under the MIT license
44
* https://github.com/tangbc/vue-virtual-scroll-list#readme
55
*/
@@ -534,12 +534,15 @@
534534
mixins: [Wrapper],
535535
props: ItemProps,
536536
render: function render(h) {
537-
var itemProps = this.extraProps || {};
538-
itemProps.source = this.source;
539-
return h(this.tag, {
537+
var tag = this.tag,
538+
component = this.component,
539+
_this$extraProps = this.extraProps,
540+
extraProps = _this$extraProps === void 0 ? {} : _this$extraProps;
541+
extraProps.source = this.source;
542+
return h(tag, {
540543
role: 'item'
541-
}, [h(this.component, {
542-
props: itemProps
544+
}, [h(component, {
545+
props: extraProps
543546
})]);
544547
}
545548
}); // wrapping for slot
@@ -548,9 +551,11 @@
548551
mixins: [Wrapper],
549552
props: SlotProps,
550553
render: function render(h) {
551-
return h(this.tag, {
554+
var tag = this.tag,
555+
uniqueKey = this.uniqueKey;
556+
return h(tag, {
552557
attrs: {
553-
role: this.uniqueKey
558+
role: uniqueKey
554559
}
555560
}, this.$slots["default"]);
556561
}
@@ -744,28 +749,36 @@
744749
// so those components that are reused will not trigger lifecycle mounted
745750
getRenderSlots: function getRenderSlots(h) {
746751
var slots = [];
747-
var start = this.range.start;
748-
var end = this.range.end;
752+
var _this$range = this.range,
753+
start = _this$range.start,
754+
end = _this$range.end;
755+
var dataSources = this.dataSources,
756+
dataKey = this.dataKey,
757+
itemClass = this.itemClass,
758+
itemTag = this.itemTag,
759+
isHorizontal = this.isHorizontal,
760+
extraProps = this.extraProps,
761+
dataComponent = this.dataComponent;
749762

750763
for (var index = start; index <= end; index++) {
751-
var dataSource = this.dataSources[index];
764+
var dataSource = dataSources[index];
752765

753766
if (dataSource) {
754-
if (dataSource[this.dataKey]) {
767+
if (dataSource[dataKey]) {
755768
slots.push(h(Item, {
756-
"class": this.itemClass,
769+
"class": itemClass,
757770
props: {
758-
tag: this.itemTag,
771+
tag: itemTag,
759772
event: EVENT_TYPE.ITEM,
760-
horizontal: this.isHorizontal,
761-
uniqueKey: dataSource[this.dataKey],
773+
horizontal: isHorizontal,
774+
uniqueKey: dataSource[dataKey],
762775
source: dataSource,
763-
extraProps: this.extraProps,
764-
component: this.dataComponent
776+
extraProps: extraProps,
777+
component: dataComponent
765778
}
766779
}));
767780
} else {
768-
console.warn("Cannot get the data-key '".concat(this.dataKey, "' from data-sources."));
781+
console.warn("Cannot get the data-key '".concat(dataKey, "' from data-sources."));
769782
}
770783
} else {
771784
console.warn("Cannot get the index '".concat(index, "' from data-sources."));
@@ -781,26 +794,33 @@
781794
var _this$$slots = this.$slots,
782795
header = _this$$slots.header,
783796
footer = _this$$slots.footer;
784-
var _this$range = this.range,
785-
padFront = _this$range.padFront,
786-
padBehind = _this$range.padBehind;
797+
var _this$range2 = this.range,
798+
padFront = _this$range2.padFront,
799+
padBehind = _this$range2.padBehind;
800+
var rootTag = this.rootTag,
801+
headerClass = this.headerClass,
802+
headerTag = this.headerTag,
803+
wrapTag = this.wrapTag,
804+
wrapClass = this.wrapClass,
805+
footerClass = this.footerClass,
806+
footerTag = this.footerTag;
787807
var padding = this.isHorizontal ? "0px ".concat(padBehind, "px 0px ").concat(padFront, "px") : "".concat(padFront, "px 0px ").concat(padBehind, "px");
788-
return h(this.rootTag, {
808+
return h(rootTag, {
789809
ref: 'root',
790810
on: {
791811
'&scroll': this.onScroll
792812
}
793813
}, [// header slot
794814
header ? h(Slot, {
795-
"class": this.headerClass,
815+
"class": headerClass,
796816
props: {
797-
tag: this.headerTag,
817+
tag: headerTag,
798818
event: EVENT_TYPE.SLOT,
799819
uniqueKey: SLOT_TYPE.HEADER
800820
}
801821
}, header) : null, // main list
802-
h(this.wrapTag, {
803-
"class": this.wrapClass,
822+
h(wrapTag, {
823+
"class": wrapClass,
804824
attrs: {
805825
role: 'group'
806826
},
@@ -809,9 +829,9 @@
809829
}
810830
}, this.getRenderSlots(h)), // footer slot
811831
footer ? h(Slot, {
812-
"class": this.footerClass,
832+
"class": footerClass,
813833
props: {
814-
tag: this.footerTag,
834+
tag: footerTag,
815835
event: EVENT_TYPE.SLOT,
816836
uniqueKey: SLOT_TYPE.FOOTER
817837
}

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>hljs.initHighlightingOnLoad()</script><link href=css/dynamic-size.9013d8ce.css rel=prefetch><link href=css/fixed-size.840ec49f.css rel=prefetch><link href=css/horizontal.c4223f3f.css rel=prefetch><link href=css/infinite-loading.4b238c18.css rel=prefetch><link href=css/keep-state.23037f2b.css rel=prefetch><link href=js/dynamic-size.631040e4.js rel=prefetch><link href=js/dynamic-size~fixed-size~horizontal~infinite-loading~keep-state.3b940789.js rel=prefetch><link href=js/fixed-size.9af085f6.js rel=prefetch><link href=js/horizontal.78fb7150.js rel=prefetch><link href=js/infinite-loading.8ae9073e.js rel=prefetch><link href=js/keep-state.0b3dbbf4.js rel=prefetch><link href=css/app.d2a3c8f3.css rel=preload as=style><link href=js/app.2bb6074c.js rel=preload as=script><link href=js/chunk-vendors.a8fb041f.js rel=preload as=script><link href=css/app.d2a3c8f3.css rel=stylesheet></head><body><div id=app></div><script src=js/chunk-vendors.a8fb041f.js></script><script src=js/app.2bb6074c.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>hljs.initHighlightingOnLoad()</script><link href=css/dynamic-size.9013d8ce.css rel=prefetch><link href=css/fixed-size.840ec49f.css rel=prefetch><link href=css/horizontal.c4223f3f.css rel=prefetch><link href=css/infinite-loading.4b238c18.css rel=prefetch><link href=css/keep-state.23037f2b.css rel=prefetch><link href=js/dynamic-size.4ca1361e.js rel=prefetch><link href=js/dynamic-size~fixed-size~horizontal~infinite-loading~keep-state.3b940789.js rel=prefetch><link href=js/fixed-size.463a787a.js rel=prefetch><link href=js/horizontal.ae821526.js rel=prefetch><link href=js/infinite-loading.6227116e.js rel=prefetch><link href=js/keep-state.22b2e66a.js rel=prefetch><link href=css/app.d2a3c8f3.css rel=preload as=style><link href=js/app.fa1284cf.js rel=preload as=script><link href=js/chunk-vendors.a8fb041f.js rel=preload as=script><link href=css/app.d2a3c8f3.css rel=stylesheet></head><body><div id=app></div><script src=js/chunk-vendors.a8fb041f.js></script><script src=js/app.fa1284cf.js></script></body></html>

docs/js/app.2bb6074c.js.map

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

docs/js/app.2bb6074c.js renamed to docs/js/app.fa1284cf.js

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

docs/js/app.fa1284cf.js.map

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/js/dynamic-size.4ca1361e.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.

docs/js/dynamic-size.4ca1361e.js.map

Lines changed: 1 addition & 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)