Skip to content

Commit 95ce62e

Browse files
committed
fix: remove getBounds()
1 parent e175f4d commit 95ce62e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/DynamicScrollerItem.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ export default {
110110
}
111111
},
112112
113-
getBounds () {
114-
return this.$el.getBoundingClientRect()
115-
},
116-
117113
updateWatchData () {
118114
if (this.watchData) {
119115
this.$_watchData = this.$watch('data', () => {
@@ -143,7 +139,10 @@ export default {
143139
computeSize (id) {
144140
this.$nextTick(() => {
145141
if (this.id === id) {
146-
const bounds = this.getBounds()
142+
const bounds = {
143+
width: this.$el.offsetWidth,
144+
height: this.$el.offsetHeight,
145+
}
147146
const size = Math.round(this.vscrollParent.direction === 'vertical' ? bounds.height : bounds.width)
148147
if (size && this.size !== size) {
149148
if (this.vscrollParent.$_undefinedMap[id]) {

0 commit comments

Comments
 (0)