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
+7 -7
View File
@@ -85,7 +85,7 @@ export default {
customStyle: '样式定制',
customColor: '颜色定制',
customWidth: '宽度定制',
counterClockwise: '逆时针'
counterClockwise: '逆时针',
},
'en-US': {
gradient: 'Gradient',
@@ -93,8 +93,8 @@ export default {
customStyle: 'Custom Style',
customColor: 'Custom Color',
customWidth: 'Custom Width',
counterClockwise: 'Counter Clockwise'
}
counterClockwise: 'Counter Clockwise',
},
},
data() {
@@ -106,8 +106,8 @@ export default {
currentRate4: 70,
gradientColor: {
'0%': '#3fecff',
'100%': '#6149f6'
}
'100%': '#6149f6',
},
};
},
@@ -118,8 +118,8 @@ export default {
reduce() {
this.rate = format(this.rate - 20);
}
}
},
},
};
</script>
+18 -18
View File
@@ -24,40 +24,40 @@ export default createComponent({
strokeLinecap: String,
value: {
type: Number,
default: 0
default: 0,
},
speed: {
type: Number,
default: 0
default: 0,
},
size: {
type: [String, Number],
default: 100
default: 100,
},
fill: {
type: String,
default: 'none'
default: 'none',
},
rate: {
type: Number,
default: 100
default: 100,
},
layerColor: {
type: String,
default: WHITE
default: WHITE,
},
color: {
type: [String, Object],
default: BLUE
default: BLUE,
},
strokeWidth: {
type: Number,
default: 40
default: 40,
},
clockwise: {
type: Boolean,
default: true
}
default: true,
},
},
beforeCreate() {
@@ -69,7 +69,7 @@ export default createComponent({
const size = addUnit(this.size);
return {
width: size,
height: size
height: size,
};
},
@@ -88,7 +88,7 @@ export default createComponent({
stroke: `${this.color}`,
strokeWidth: `${this.strokeWidth + 1}px`,
strokeLinecap: this.strokeLinecap,
strokeDasharray: `${offset}px ${PERIMETER}px`
strokeDasharray: `${offset}px ${PERIMETER}px`,
};
},
@@ -96,7 +96,7 @@ export default createComponent({
return {
fill: `${this.fill}`,
stroke: `${this.layerColor}`,
strokeWidth: `${this.strokeWidth}px`
strokeWidth: `${this.strokeWidth}px`,
};
},
@@ -122,7 +122,7 @@ export default createComponent({
</linearGradient>
</defs>
);
}
},
},
watch: {
@@ -143,8 +143,8 @@ export default createComponent({
this.$emit('input', this.endRate);
}
},
immediate: true
}
immediate: true,
},
},
methods: {
@@ -158,7 +158,7 @@ export default createComponent({
if (this.increase ? rate < this.endRate : rate > this.endRate) {
this.rafId = raf(this.animate);
}
}
},
},
render() {
@@ -178,5 +178,5 @@ export default createComponent({
(this.text && <div class={bem('text')}>{this.text}</div>)}
</div>
);
}
},
});
+10 -10
View File
@@ -6,15 +6,15 @@ test('speed is 0', async () => {
const wrapper = mount(Circle, {
propsData: {
rate: 50,
value: 0
value: 0,
},
listeners: {
input(value) {
Vue.nextTick(() => {
wrapper.setProps({ value });
});
}
}
},
},
});
await later();
@@ -26,11 +26,11 @@ test('animate', async () => {
mount(Circle, {
propsData: {
rate: 50,
speed: 100
speed: 100,
},
listeners: {
input: onInput
}
input: onInput,
},
});
await later(50);
@@ -41,8 +41,8 @@ test('animate', async () => {
test('size prop', () => {
const wrapper = mount(Circle, {
propsData: {
size: 100
}
size: 100,
},
});
expect(wrapper).toMatchSnapshot();
@@ -51,8 +51,8 @@ test('size prop', () => {
test('stroke-linecap prop', () => {
const wrapper = mount(Circle, {
propsData: {
strokeLinecap: 'square'
}
strokeLinecap: 'square',
},
});
expect(wrapper).toMatchSnapshot();