Skip to content

Commit 76c323d

Browse files
andrieputangbc
authored andcommitted
$refs.vsl can be a component
1 parent 62b2435 commit 76c323d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@
9090
methods: {
9191
onScroll: function (e) {
9292
var delta = this.delta
93-
var offset = (this.$refs.vsl && this.$refs.vsl.scrollTop) || 0
93+
var vsl = this.$refs.vsl;
94+
var offset = (vsl && (vsl instanceof Vue2 ? vsl.$el : vsl).scrollTop) || 0
9495

9596
if (delta.total > delta.keeps) {
9697
this.updateZone(offset)
@@ -284,7 +285,7 @@
284285
setScrollTop: function (scrollTop) {
285286
var vsl = this.$refs.vsl
286287
if (vsl) {
287-
vsl.scrollTop = scrollTop
288+
(vsl instanceof Vue2 ? vsl.$el : vsl).scrollTop = scrollTop
288289
}
289290
},
290291

0 commit comments

Comments
 (0)