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
+5 -5
View File
@@ -64,7 +64,7 @@ export default {
customIcon: '自定义图标',
customStyle: '自定义样式',
customCount: '自定义数量',
readonly: '只读状态'
readonly: '只读状态',
},
'en-US': {
halfStar: 'Half Star',
@@ -72,8 +72,8 @@ export default {
customIcon: 'Custom Icon',
customStyle: 'Custom Style',
customCount: 'Custom Count',
readonly: 'Readonly'
}
readonly: 'Readonly',
},
},
data() {
@@ -83,9 +83,9 @@ export default {
value3: 3,
value4: 2.5,
value5: 4,
value6: 3
value6: 3,
};
}
},
};
</script>
+14 -14
View File
@@ -28,36 +28,36 @@ export default createComponent({
allowHalf: Boolean,
value: {
type: Number,
default: 0
default: 0,
},
icon: {
type: String,
default: 'star'
default: 'star',
},
voidIcon: {
type: String,
default: 'star-o'
default: 'star-o',
},
color: {
type: String,
default: '#ffd21e'
default: '#ffd21e',
},
voidColor: {
type: String,
default: '#c7c7c7'
default: '#c7c7c7',
},
disabledColor: {
type: String,
default: '#bdbdbd'
default: '#bdbdbd',
},
count: {
type: Number,
default: 5
default: 5,
},
touchable: {
type: Boolean,
default: true
}
default: true,
},
},
computed: {
@@ -76,7 +76,7 @@ export default createComponent({
gutterWithUnit() {
return addUnit(this.gutter);
}
},
},
mounted() {
@@ -148,7 +148,7 @@ export default createComponent({
voidIcon,
disabled,
voidColor,
disabledColor
disabledColor,
} = this;
const score = index + 1;
const isFull = status === 'full';
@@ -196,7 +196,7 @@ export default createComponent({
)}
</div>
);
}
},
},
render() {
@@ -204,7 +204,7 @@ export default createComponent({
<div
class={bem({
readonly: this.readonly,
disabled: this.disabled
disabled: this.disabled,
})}
tabindex="0"
role="radiogroup"
@@ -212,5 +212,5 @@ export default createComponent({
{this.list.map((status, index) => this.genStar(status, index))}
</div>
);
}
},
});
+21 -21
View File
@@ -5,7 +5,7 @@ function mockGetBoundingClientRect(items) {
items.filter((icon, index) => {
icon.element.getBoundingClientRect = () => ({
left: index * 25,
width: 25
width: 25,
});
return true;
});
@@ -21,8 +21,8 @@ test('change event', () => {
onInput(value);
wrapper.setProps({ value });
},
change: onChange
}
change: onChange,
},
});
const item4 = wrapper.findAll('.van-rate__icon').at(3);
@@ -41,12 +41,12 @@ test('allow half', () => {
const wrapper = mount(Rate, {
propsData: {
allowHalf: true
allowHalf: true,
},
listeners: {
input: onInput,
change: onChange
}
change: onChange,
},
});
const item4 = wrapper.findAll('.van-rate__icon--half').at(3);
@@ -61,12 +61,12 @@ test('disabled', () => {
const wrapper = mount(Rate, {
propsData: {
disabled: true
disabled: true,
},
listeners: {
input: onInput,
change: onChange
}
change: onChange,
},
});
const item4 = wrapper.findAll('.van-rate__item').at(3);
@@ -81,8 +81,8 @@ test('touchmove to select item', () => {
const onChange = jest.fn();
const wrapper = mount(Rate, {
listeners: {
change: onChange
}
change: onChange,
},
});
const icons = wrapper.findAll('.van-rate__item');
@@ -100,11 +100,11 @@ test('touchmove to select half item', () => {
const onChange = jest.fn();
const wrapper = mount(Rate, {
propsData: {
allowHalf: true
allowHalf: true,
},
listeners: {
change: onChange
}
change: onChange,
},
});
const icons = wrapper.findAll('.van-rate__item');
@@ -121,8 +121,8 @@ test('touchmove to select half item', () => {
test('gutter prop', () => {
const wrapper = mount(Rate, {
propsData: {
gutter: 10
}
gutter: 10,
},
});
expect(wrapper).toMatchSnapshot();
@@ -131,8 +131,8 @@ test('gutter prop', () => {
test('size prop', () => {
const wrapper = mount(Rate, {
propsData: {
size: '2rem'
}
size: '2rem',
},
});
expect(wrapper).toMatchSnapshot();
@@ -142,11 +142,11 @@ test('untouchable', () => {
const onChange = jest.fn();
const wrapper = mount(Rate, {
propsData: {
touchable: false
touchable: false,
},
listeners: {
change: onChange
}
change: onChange,
},
});
triggerDrag(wrapper, 100, 0);