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
+8 -8
View File
@@ -40,13 +40,13 @@
<van-radio name="1">
{{ $t('radio') }} 1
<template #icon="{ checked }">
<img :src="checked ? icon.active : icon.inactive">
<img :src="checked ? icon.active : icon.inactive" />
</template>
</van-radio>
<van-radio name="2">
{{ $t('radio') }} 2
<template #icon="{ checked }">
<img :src="checked ? icon.active : icon.inactive">
<img :src="checked ? icon.active : icon.inactive" />
</template>
</van-radio>
</van-radio-group>
@@ -90,7 +90,7 @@ export default {
customColor: '自定义颜色',
customShape: '自定义形状',
withCell: '与 Cell 组件一起使用',
disabledLabelClick: '禁用文本点击'
disabledLabelClick: '禁用文本点击',
},
'en-US': {
radio: 'Radio',
@@ -101,8 +101,8 @@ export default {
customColor: 'Custom Color',
customShape: 'Custom Shape',
withCell: 'Inside a Cell',
disabledLabelClick: 'Disable the click event of label'
}
disabledLabelClick: 'Disable the click event of label',
},
},
data() {
@@ -117,10 +117,10 @@ export default {
radioShape: '1',
icon: {
active: 'https://img.yzcdn.cn/vant/user-active.png',
inactive: 'https://img.yzcdn.cn/vant/user-inactive.png'
}
inactive: 'https://img.yzcdn.cn/vant/user-inactive.png',
},
};
}
},
};
</script>
+5 -5
View File
@@ -7,7 +7,7 @@ export default createComponent({
mixins: [CheckboxMixin({
bem,
role: 'radio',
parent: 'vanRadio'
parent: 'vanRadio',
})],
computed: {
@@ -18,17 +18,17 @@ export default createComponent({
set(val) {
(this.parent || this).$emit('input', val);
}
},
},
checked() {
return this.currentValue === this.name;
}
},
},
methods: {
toggle() {
this.currentValue = this.name;
}
}
},
},
});
+6 -6
View File
@@ -17,9 +17,9 @@ test('radio-group change', () => {
data() {
return {
result: 'a',
list: ['a', 'b', 'c', 'd']
list: ['a', 'b', 'c', 'd'],
};
}
},
});
const icons = wrapper.findAll('.van-radio__icon');
@@ -54,9 +54,9 @@ test('radio group disabled', () => {
data() {
return {
result: 'a',
list: ['a', 'b', 'c', 'd']
list: ['a', 'b', 'c', 'd'],
};
}
},
});
const icons = wrapper.findAll('.van-radio__icon');
@@ -72,7 +72,7 @@ test('icon-size prop', () => {
<van-radio>label</van-radio>
<van-radio icon-size="5rem">label</van-radio>
</van-radio-group>
`
`,
});
expect(wrapper).toMatchSnapshot();
@@ -85,7 +85,7 @@ test('checked-color prop', () => {
<van-radio :value="true">label</van-radio>
<van-radio :value="true" checked-color="white">label</van-radio>
</van-radio-group>
`
`,
});
expect(wrapper).toMatchSnapshot();