chore: add trailingComma

This commit is contained in:
陈嘉涵
2020-01-19 11:57:09 +08:00
parent e841175fe8
commit 389d68884d
269 changed files with 2706 additions and 2702 deletions
+6 -6
View File
@@ -12,7 +12,7 @@ export default createComponent({
duration: Number,
animated: Boolean,
swipeable: Boolean,
currentIndex: Number
currentIndex: Number,
},
computed: {
@@ -20,7 +20,7 @@ export default createComponent({
if (this.animated) {
return {
transform: `translate3d(${-1 * this.currentIndex * 100}%, 0, 0)`,
transitionDuration: `${this.duration}s`
transitionDuration: `${this.duration}s`,
};
}
},
@@ -31,10 +31,10 @@ export default createComponent({
touchstart: this.touchStart,
touchmove: this.touchMove,
touchend: this.onTouchEnd,
touchcancel: this.onTouchEnd
touchcancel: this.onTouchEnd,
};
}
}
},
},
methods: {
@@ -63,7 +63,7 @@ export default createComponent({
}
return this.slots();
}
},
},
render() {
@@ -75,5 +75,5 @@ export default createComponent({
{this.genChildren()}
</div>
);
}
},
});
+7 -7
View File
@@ -16,7 +16,7 @@ export default createComponent({
scrollable: Boolean,
activeColor: String,
inactiveColor: String,
swipeThreshold: Number
swipeThreshold: Number,
},
computed: {
@@ -48,13 +48,13 @@ export default createComponent({
}
return style;
}
},
},
methods: {
onClick() {
this.$emit('click');
}
},
},
render() {
@@ -66,11 +66,11 @@ export default createComponent({
bem({
active: this.isActive,
disabled: this.disabled,
complete: !this.ellipsis
complete: !this.ellipsis,
}),
{
'van-ellipsis': this.ellipsis
}
'van-ellipsis': this.ellipsis,
},
]}
style={this.style}
onClick={this.onClick}
@@ -81,5 +81,5 @@ export default createComponent({
</span>
</div>
);
}
},
});
+22 -22
View File
@@ -10,7 +10,7 @@ import {
setRootScrollTop,
getElementTop,
getVisibleHeight,
getVisibleTop
getVisibleTop,
} from '../utils/dom/scroll';
import Title from './Title';
@@ -27,11 +27,11 @@ export default createComponent({
if (this.scrollspy) {
bind(window, 'scroll', this.onScroll, true);
}
})
}),
],
model: {
prop: 'active'
prop: 'active',
},
props: {
@@ -47,36 +47,36 @@ export default createComponent({
titleInactiveColor: String,
type: {
type: String,
default: 'line'
default: 'line',
},
active: {
type: [Number, String],
default: 0
default: 0,
},
border: {
type: Boolean,
default: true
default: true,
},
ellipsis: {
type: Boolean,
default: true
default: true,
},
duration: {
type: Number,
default: 0.3
default: 0.3,
},
offsetTop: {
type: Number,
default: 0
default: 0,
},
lazyRender: {
type: Boolean,
default: true
default: true,
},
swipeThreshold: {
type: Number,
default: 4
}
default: 4,
},
},
data() {
@@ -84,8 +84,8 @@ export default createComponent({
position: '',
currentIndex: null,
lineStyle: {
backgroundColor: this.color
}
backgroundColor: this.color,
},
};
},
@@ -98,7 +98,7 @@ export default createComponent({
navStyle() {
return {
borderColor: this.color,
background: this.background
background: this.background,
};
},
@@ -115,7 +115,7 @@ export default createComponent({
return this.offsetTop + this.tabHeight;
}
return 0;
}
},
},
watch: {
@@ -152,7 +152,7 @@ export default createComponent({
} else {
off(window, 'scroll', this.onScroll);
}
}
},
},
mounted() {
@@ -202,7 +202,7 @@ export default createComponent({
const lineStyle = {
width: addUnit(width),
backgroundColor: this.color,
transform: `translateX(${left}px) translateX(-50%)`
transform: `translateX(${left}px) translateX(-50%)`,
};
if (shouldAnimate) {
@@ -321,7 +321,7 @@ export default createComponent({
}
return children.length - 1;
}
},
},
render() {
@@ -345,7 +345,7 @@ export default createComponent({
inactiveColor={this.titleInactiveColor}
swipeThreshold={this.swipeThreshold}
scopedSlots={{
default: () => item.slots('title')
default: () => item.slots('title'),
}}
onClick={() => {
this.onClick(index);
@@ -359,7 +359,7 @@ export default createComponent({
ref="wrap"
class={[
bem('wrap', { scrollable }),
{ [BORDER_TOP_BOTTOM]: type === 'line' && this.border }
{ [BORDER_TOP_BOTTOM]: type === 'line' && this.border },
]}
>
<div
@@ -403,5 +403,5 @@ export default createComponent({
</Content>
</div>
);
}
},
});