Skip to content

Commit 590740c

Browse files
authored
Merge pull request #22 from thomasyxy/master
scroll bind has error
2 parents da1c34a + 8c94c13 commit 590740c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ export default function install (Vue, options) {
8989

9090
function initScrollSections (el, sectionSelector) {
9191
const id = scrollSpyId(el)
92-
const scrollSpyContext = el[scrollSpyContext]
92+
const scrollSpyContextEl = el[scrollSpyContext]
9393
const idScrollSections = findElements(el, sectionSelector)
9494
scrollSpySections[id] = idScrollSections
9595

9696
if (idScrollSections[0] && idScrollSections[0].offsetParent !== el) {
97-
scrollSpyContext.eventEl = window
98-
scrollSpyContext.scrollEl = bodyScrollEl
97+
scrollSpyContextEl.eventEl = window
98+
scrollSpyContextEl.scrollEl = bodyScrollEl
9999
}
100100
}
101101

@@ -205,9 +205,9 @@ export default function install (Vue, options) {
205205
delete currentIndex[id]
206206
},
207207
inserted: function (el) {
208-
const {eventEl, onScroll, options: {sectionSelector}} = el[scrollSpyContext]
209-
208+
const {options: {sectionSelector}} = el[scrollSpyContext]
210209
initScrollSections(el, sectionSelector)
210+
const {eventEl, onScroll} = el[scrollSpyContext]
211211
eventEl.addEventListener('scroll', onScroll)
212212

213213
onScroll()

0 commit comments

Comments
 (0)