chore: code review

This commit is contained in:
chenjiahan
2020-03-01 20:29:03 +08:00
parent 5d3333ca8c
commit 65bdc75ca6
4 changed files with 7 additions and 13 deletions

View File

@@ -76,7 +76,6 @@ export default createComponent({
highlightStyle() {
const { highlightColor } = this;
if (highlightColor) {
/* istanbul ignore else */
return {
color: highlightColor,
};
@@ -135,17 +134,14 @@ export default createComponent({
},
getScrollerRect() {
const { scroller } = this;
let scrollerRect = {
if (this.scroller.getBoundingClientRect) {
return this.scroller.getBoundingClientRect();
}
return {
top: 0,
left: 0,
};
if (scroller.getBoundingClientRect) {
scrollerRect = scroller.getBoundingClientRect();
}
return scrollerRect;
},
getElementTop(ele, scrollerRect) {