Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
feat: Add updateScrollbar method
Browse files Browse the repository at this point in the history
  • Loading branch information
dwqs committed Mar 15, 2018
1 parent 453f0ae commit ffdd68f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/components/table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,7 @@
if (this.isMetLazyLoad) {
this.initRenderRows();
if (this.scrollbar) {
this.$nextTick(() => {
this.scrollbar.update({
contentHeight: this.contentHeight
});
});
this.updateScrollbar();
}
} else {
this.rows = [].concat(val);
Expand Down Expand Up @@ -487,6 +483,7 @@
},
methods: {
// exposed table method
toggleRowSelection (row, selected) {
const curIndex = findIndex(this.rows, row);
Expand All @@ -503,6 +500,18 @@
}
},
updateScrollbar () {
if (this.scrollbar) {
this.$nextTick(() => {
this.scrollbar.update({
contentWidth: this.$refs.content.scrollWidth,
contentHeight: this.isMetLazyLoad ? this.contentHeight : this.$refs.content.scrollHeight
});
});
}
},
// exposed table method --end
toggleSelect (rowIndex) {
if (this.selectedIndex.includes(rowIndex)) {
this.handleRowSelect(false, rowIndex);
Expand Down

0 comments on commit ffdd68f

Please sign in to comment.