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
+3 -3
View File
@@ -77,7 +77,7 @@ function AddressItem(
{`${data.name} ${data.tel}`}
{genTag()}
</div>,
<div class={bem('address')}>{data.address}</div>
<div class={bem('address')}>{data.address}</div>,
];
if (switchable && !disabled) {
@@ -99,7 +99,7 @@ function AddressItem(
clickable={switchable && !disabled}
scopedSlots={{
default: genContent,
'right-icon': genRightIcon
'right-icon': genRightIcon,
}}
onClick={onClick}
{...inherit(ctx)}
@@ -111,7 +111,7 @@ AddressItem.props = {
data: Object,
disabled: Boolean,
switchable: Boolean,
defaultTagText: String
defaultTagText: String,
};
export default createComponent<AddressItemProps, AddressItemEvents>(
+16 -16
View File
@@ -24,27 +24,27 @@ export default {
name: '张三',
tel: '13000000000',
address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
isDefault: true
isDefault: true,
},
{
id: '2',
name: '李四',
tel: '1310000000',
address: '浙江省杭州市拱墅区莫干山路 50 号'
}
address: '浙江省杭州市拱墅区莫干山路 50 号',
},
],
disabledList: [
{
id: '3',
name: '王五',
tel: '1320000000',
address: '浙江省杭州市滨江区江南大道 15 号'
}
address: '浙江省杭州市滨江区江南大道 15 号',
},
],
add: '新增地址',
edit: '编辑地址',
disabledText: '以下地址超出配送范围',
defaultTagText: '默认'
defaultTagText: '默认',
},
'en-US': {
list: [
@@ -53,33 +53,33 @@ export default {
name: 'John Snow',
tel: '13000000000',
address: 'Somewhere',
isDefault: true
isDefault: true,
},
{
id: '2',
name: 'Ned Stark',
tel: '1310000000',
address: 'Somewhere'
}
address: 'Somewhere',
},
],
disabledList: [
{
id: '3',
name: 'Tywin',
tel: '1320000000',
address: 'Somewhere'
}
address: 'Somewhere',
},
],
add: 'Add',
edit: 'Edit',
disabledText: 'The following address is out of range',
defaultTagText: 'Default'
}
defaultTagText: 'Default',
},
},
data() {
return {
chosenAddressId: '1'
chosenAddressId: '1',
};
},
@@ -90,8 +90,8 @@ export default {
onEdit(item, index) {
this.$toast(`${this.$t('edit')}:${index}`);
}
}
},
},
};
</script>
+2 -2
View File
@@ -94,8 +94,8 @@ AddressList.props = {
defaultTagText: String,
switchable: {
type: Boolean,
default: true
}
default: true,
},
};
export default createComponent<AddressListProps>(AddressList);
+13 -13
View File
@@ -6,22 +6,22 @@ const list = [
id: '1',
name: '张三',
tel: '13000000000',
address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室'
address: '浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室',
},
{
id: '2',
name: '李四',
tel: '1310000000',
address: '浙江省杭州市拱墅区莫干山路 50 号'
}
address: '浙江省杭州市拱墅区莫干山路 50 号',
},
];
test('unswitchable', () => {
const wrapper = mount(AddressList, {
propsData: {
list,
switchable: false
}
switchable: false,
},
});
expect(wrapper).toMatchSnapshot();
@@ -31,13 +31,13 @@ test('select event', () => {
const onSelect = jest.fn();
const wrapper = mount(AddressList, {
propsData: {
list
list,
},
context: {
on: {
select: onSelect
}
}
select: onSelect,
},
},
});
wrapper.find('.van-radio__icon').trigger('click');
@@ -49,13 +49,13 @@ test('click-item event', () => {
const onClickItem = jest.fn();
const wrapper = mount(AddressList, {
propsData: {
list
list,
},
context: {
on: {
'click-item': onClickItem
}
}
'click-item': onClickItem,
},
},
});
wrapper.find('.van-address-item').trigger('click');