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
@@ -56,13 +56,13 @@ export default {
'zh-CN': {
name: '张三',
defaultLabel: '设为默认联系人',
defaultTagText: '默认'
defaultTagText: '默认',
},
'en-US': {
name: 'John Snow',
defaultLabel: 'Set as the default contact',
defaultTagText: 'default'
}
defaultTagText: 'default',
},
},
data() {
@@ -72,7 +72,7 @@ export default {
showList: false,
showEdit: false,
isEdit: false,
list: []
list: [],
};
},
@@ -82,7 +82,7 @@ export default {
name: this.$t('name'),
tel: '13000000000',
id: 0,
isDefault: 1
isDefault: 1,
};
},
@@ -93,7 +93,7 @@ export default {
currentContact() {
const id = this.chosenContactId;
return id !== null ? this.list.filter(item => item.id === id)[0] : {};
}
},
},
created() {
@@ -135,8 +135,8 @@ export default {
if (this.chosenContactId === info.id) {
this.chosenContactId = null;
}
}
}
},
},
};
</script>
+4 -4
View File
@@ -37,7 +37,7 @@ function ContactCard(
return [
<div>{`${t('name')}${props.name}`}</div>,
<div>{`${t('tel')}${props.tel}`}</div>
<div>{`${t('tel')}${props.tel}`}</div>,
];
}
@@ -63,12 +63,12 @@ ContactCard.props = {
addText: String,
editable: {
type: Boolean,
default: true
default: true,
},
type: {
type: String,
default: 'add'
}
default: 'add',
},
};
export default createComponent<ContactCardProps>(ContactCard);
+20 -20
View File
@@ -5,7 +5,7 @@ import { mount, later } from '../../../test';
const contactInfo = {
name: 'test',
tel: '123123213'
tel: '123123213',
};
describe('ContactCard', () => {
@@ -14,9 +14,9 @@ describe('ContactCard', () => {
const wrapper = mount(ContactCard, {
context: {
on: {
click
}
}
click,
},
},
});
wrapper.trigger('click');
@@ -27,13 +27,13 @@ describe('ContactCard', () => {
const click = jest.fn();
const wrapper = mount(ContactCard, {
propsData: {
editable: false
editable: false,
},
context: {
on: {
click
}
}
click,
},
},
});
wrapper.trigger('click');
@@ -45,8 +45,8 @@ describe('ContactList', () => {
test('render', () => {
const wrapper = mount(ContactList, {
propsData: {
list: [contactInfo]
}
list: [contactInfo],
},
});
expect(wrapper).toMatchSnapshot();
});
@@ -55,13 +55,13 @@ describe('ContactList', () => {
const onSelect = jest.fn();
const wrapper = mount(ContactList, {
propsData: {
list: [contactInfo]
list: [contactInfo],
},
context: {
on: {
select: onSelect
}
}
select: onSelect,
},
},
});
wrapper.find('.van-radio__icon').trigger('click');
@@ -74,8 +74,8 @@ describe('ContactEdit', () => {
const createComponent = () => {
const wrapper = mount(ContactEdit, {
propsData: {
contactInfo
}
contactInfo,
},
});
const button = wrapper.find('.van-button');
@@ -86,7 +86,7 @@ describe('ContactEdit', () => {
data,
field,
button,
errorInfo
errorInfo,
};
};
@@ -114,7 +114,7 @@ describe('ContactEdit', () => {
expect(errorInfo.tel).toBeFalsy();
expect(wrapper.emitted('save')[0][0]).toEqual({
name: 'test',
tel: '13000000000'
tel: '13000000000',
});
});
@@ -127,8 +127,8 @@ describe('ContactEdit', () => {
test('delete contact', async () => {
const wrapper = mount(ContactEdit, {
propsData: {
isEdit: true
}
isEdit: true,
},
});
const deleteButton = wrapper.findAll('.van-button').at(1);