fix: sonar code smell

This commit is contained in:
07akioni 2020-03-04 23:47:59 +08:00
parent d6ef32aa68
commit c3c5c0942e

View File

@ -325,12 +325,12 @@ export default {
if (this.virtualScroll) {
if (index !== null) {
this.pendingWrappedOption = this.flattenedOptions[index]
const itemSize = this.itemSize
const offsetTop = itemSize * index
const size = this.itemSize
const offsetTop = size * index
this.updateTrackingRectTop({
offsetTop
})
doScroll && this.$refs.scrollbar.scrollToElement({}, () => offsetTop, () => itemSize)
doScroll && this.$refs.scrollbar.scrollToElement({}, () => offsetTop, () => size)
}
} else {
this.pendingWrappedOption = this.flattenedOptions[index]