mirror of
https://github.com/youzan/vant.git
synced 2026-05-06 01:00:26 +08:00
chore: add trailingComma
This commit is contained in:
@@ -31,14 +31,14 @@ export default {
|
||||
'zh-CN': {
|
||||
title2: '置灰',
|
||||
title3: '样式定制',
|
||||
strokeWidth: '线条粗细'
|
||||
strokeWidth: '线条粗细',
|
||||
},
|
||||
'en-US': {
|
||||
title2: 'Inactive',
|
||||
title3: 'Custom Style',
|
||||
strokeWidth: 'Stroke Width'
|
||||
}
|
||||
}
|
||||
strokeWidth: 'Stroke Width',
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
+10
-10
@@ -14,18 +14,18 @@ export default createComponent({
|
||||
percentage: {
|
||||
type: Number,
|
||||
required: true,
|
||||
validator: value => value >= 0 && value <= 100
|
||||
validator: value => value >= 0 && value <= 100,
|
||||
},
|
||||
showPivot: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
pivotWidth: 0,
|
||||
progressWidth: 0
|
||||
progressWidth: 0,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@ export default createComponent({
|
||||
|
||||
watch: {
|
||||
showPivot: 'setWidth',
|
||||
pivotText: 'setWidth'
|
||||
pivotText: 'setWidth',
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -44,7 +44,7 @@ export default createComponent({
|
||||
this.progressWidth = this.$el.offsetWidth;
|
||||
this.pivotWidth = this.$refs.pivot ? this.$refs.pivot.offsetWidth : 0;
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
render() {
|
||||
@@ -56,17 +56,17 @@ export default createComponent({
|
||||
const pivotStyle = {
|
||||
color: this.textColor,
|
||||
left: `${((this.progressWidth - this.pivotWidth) * percentage) / 100}px`,
|
||||
background: this.pivotColor || background
|
||||
background: this.pivotColor || background,
|
||||
};
|
||||
|
||||
const portionStyle = {
|
||||
background,
|
||||
width: (this.progressWidth * percentage) / 100 + 'px'
|
||||
width: (this.progressWidth * percentage) / 100 + 'px',
|
||||
};
|
||||
|
||||
const wrapperStyle = {
|
||||
background: this.trackColor,
|
||||
height: addUnit(this.strokeWidth)
|
||||
height: addUnit(this.strokeWidth),
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -80,5 +80,5 @@ export default createComponent({
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -5,8 +5,8 @@ test('calc width', async () => {
|
||||
const wrapper = mount(Progress, {
|
||||
propsData: {
|
||||
showPivot: false,
|
||||
percentage: 100
|
||||
}
|
||||
percentage: 100,
|
||||
},
|
||||
});
|
||||
await later();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -20,8 +20,8 @@ test('calc width', async () => {
|
||||
test('track color prop', async () => {
|
||||
const wrapper = mount(Progress, {
|
||||
propsData: {
|
||||
trackColor: 'green'
|
||||
}
|
||||
trackColor: 'green',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper.element.style.background).toEqual('green');
|
||||
|
||||
Reference in New Issue
Block a user