fix: fix undefined error in media dialog scroll (#1048)
This commit is contained in:
parent
b7299f53fb
commit
b0aa86ef44
|
@ -266,7 +266,11 @@
|
|||
},
|
||||
onScroll () {
|
||||
let { length } = this.get()
|
||||
let { scrollWidth, scrollLeft } = this.refs.scroller
|
||||
let { scroller } = this.refs
|
||||
if (!scroller) {
|
||||
return
|
||||
}
|
||||
let { scrollWidth, scrollLeft } = scroller
|
||||
let scrolledItem = Math.round((scrollLeft / scrollWidth) * length)
|
||||
this.set({ scrolledItem })
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue