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

@ -85,7 +85,7 @@ export default createComponent({
value={this.chosen} value={this.chosen}
class={bem('corner')} class={bem('corner')}
size={18} size={18}
checked-color={RED} checkedColor={RED}
/> />
)} )}
</div> </div>

View File

@ -14,8 +14,8 @@ export type IconProps = {
tag: keyof HTMLElementTagNameMap | string; tag: keyof HTMLElementTagNameMap | string;
name?: string; name?: string;
size?: string | number; size?: string | number;
color?: string;
info?: string | number; info?: string | number;
color?: string;
classPrefix: string; classPrefix: string;
}; };

View File

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

View File

@ -1,14 +1,12 @@
// color // color
export const RED = '#ee0a24'; export const RED = '#ee0a24';
export const BLUE = '#1989fa'; export const BLUE = '#1989fa';
export const GREEN = '#07c160';
export const WHITE = '#fff'; export const WHITE = '#fff';
// border // border
export const BORDER = 'van-hairline'; export const BORDER = 'van-hairline';
export const BORDER_TOP = `${BORDER}--top`; export const BORDER_TOP = `${BORDER}--top`;
export const BORDER_LEFT = `${BORDER}--left`; export const BORDER_LEFT = `${BORDER}--left`;
export const BORDER_RIGHT = `${BORDER}--right`;
export const BORDER_BOTTOM = `${BORDER}--bottom`; export const BORDER_BOTTOM = `${BORDER}--bottom`;
export const BORDER_SURROUND = `${BORDER}--surround`; export const BORDER_SURROUND = `${BORDER}--surround`;
export const BORDER_TOP_BOTTOM = `${BORDER}--top-bottom`; export const BORDER_TOP_BOTTOM = `${BORDER}--top-bottom`;