|
1 | 1 | /*!
|
2 |
| - * vue-virtual-scroll-list v2.1.3 |
| 2 | + * vue-virtual-scroll-list v2.1.4 |
3 | 3 | * open source under the MIT license
|
4 | 4 | * https://github.com/tangbc/vue-virtual-scroll-list#readme
|
5 | 5 | */
|
|
670 | 670 | var shepherd = this.$refs.shepherd;
|
671 | 671 |
|
672 | 672 | if (shepherd) {
|
673 |
| - shepherd.scrollIntoView(false); // check if it's really scrolled to the bottom |
| 673 | + var offset = shepherd[this.isHorizontal ? 'offsetLeft' : 'offsetTop']; |
| 674 | + this.scrollToOffset(offset); // check if it's really scrolled to the bottom |
674 | 675 | // maybe list doesn't render and calculate to last range
|
675 | 676 | // so we need retry in next event loop until it really at bottom
|
676 | 677 |
|
|
772 | 773 | var dataSource = dataSources[index];
|
773 | 774 |
|
774 | 775 | if (dataSource) {
|
775 |
| - if (dataSource[dataKey]) { |
| 776 | + if (Object.prototype.hasOwnProperty.call(dataSource, dataKey)) { |
776 | 777 | slots.push(h(Item, {
|
777 | 778 | props: {
|
778 | 779 | index: index,
|
|
812 | 813 | wrapTag = this.wrapTag,
|
813 | 814 | wrapClass = this.wrapClass,
|
814 | 815 | footerClass = this.footerClass,
|
815 |
| - footerTag = this.footerTag; |
816 |
| - var padding = this.isHorizontal ? "0px ".concat(padBehind, "px 0px ").concat(padFront, "px") : "".concat(padFront, "px 0px ").concat(padBehind, "px"); |
| 816 | + footerTag = this.footerTag, |
| 817 | + isHorizontal = this.isHorizontal; |
| 818 | + var padding = isHorizontal ? "0px ".concat(padBehind, "px 0px ").concat(padFront, "px") : "".concat(padFront, "px 0px ").concat(padBehind, "px"); |
817 | 819 | return h(rootTag, {
|
818 | 820 | ref: 'root',
|
819 | 821 | on: {
|
|
846 | 848 | }
|
847 | 849 | }, footer) : null, // an empty element use to scroll to bottom
|
848 | 850 | h('div', {
|
849 |
| - ref: 'shepherd' |
| 851 | + ref: 'shepherd', |
| 852 | + style: { |
| 853 | + width: isHorizontal ? '0px' : '100%', |
| 854 | + height: isHorizontal ? '100%' : '0px' |
| 855 | + } |
850 | 856 | })]);
|
851 | 857 | }
|
852 | 858 | });
|
|
0 commit comments