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
+4 -4
View File
@@ -2,7 +2,7 @@ export default {
province_list: {
110000: 'Beijing',
330000: 'Zhejiang',
810000: 'Hong Kong'
810000: 'Hong Kong',
},
city_list: {
110100: 'Beijing City',
@@ -13,7 +13,7 @@ export default {
331100: 'Lishui',
810100: 'Hong Kong Island',
810200: 'Kowloon',
810300: 'New Territories'
810300: 'New Territories',
},
county_list: {
110101: 'Dongcheng',
@@ -66,6 +66,6 @@ export default {
810305: 'Yuen Long',
810306: 'Tuen Mun',
810307: 'Tsuen Wan',
810309: 'Lantau Island'
}
810309: 'Lantau Island',
},
};
+4 -4
View File
@@ -34,7 +34,7 @@ export default {
710000: '台湾省',
810000: '香港特别行政区',
820000: '澳门特别行政区',
900000: '海外'
900000: '海外',
},
city_list: {
110100: '北京市',
@@ -648,7 +648,7 @@ export default {
987600: '瓦利斯和富图纳',
988200: '萨摩亚',
988700: '也门',
989400: '赞比亚'
989400: '赞比亚',
},
county_list: {
110101: '东城区',
@@ -4035,6 +4035,6 @@ export default {
810308: '葵青区',
810309: '离岛区',
820101: '澳门半岛',
820201: '离岛'
}
820201: '离岛',
},
};
+4 -4
View File
@@ -1,13 +1,13 @@
export default {
province_list: {
110000: '北京市',
120000: '天津市'
120000: '天津市',
},
city_list: {
110100: '北京市',
110200: '县',
120100: '天津市',
120200: '县'
120200: '县',
},
county_list: {
110101: '东城区',
@@ -16,6 +16,6 @@ export default {
110229: '延庆县',
120101: '和平区',
120102: '河东区',
120225: '蓟县'
}
120225: '蓟县',
},
};
+3 -3
View File
@@ -48,13 +48,13 @@ export default {
title4: 'Columns Placeholder',
columnsPlaceholder: ['Choose', 'Choose', 'Choose'],
areaList: AreaListEn,
}
},
},
data() {
return {
value: '330302'
value: '330302',
};
}
},
};
</script>
+17 -17
View File
@@ -16,26 +16,26 @@ export default createComponent({
value: String,
areaList: {
type: Object,
default: () => ({})
default: () => ({}),
},
columnsNum: {
type: [Number, String],
default: 3
default: 3,
},
isOverseaCode: {
type: Function,
default: isOverseaCode
default: isOverseaCode,
},
columnsPlaceholder: {
type: Array,
default: () => []
}
default: () => [],
},
},
data() {
return {
code: this.value,
columns: [{ values: [] }, { values: [] }, { values: [] }]
columns: [{ values: [] }, { values: [] }, { values: [] }],
};
},
@@ -60,9 +60,9 @@ export default createComponent({
return {
province: this.columnsPlaceholder[0] || '',
city: this.columnsPlaceholder[1] || '',
county: this.columnsPlaceholder[2] || ''
county: this.columnsPlaceholder[2] || '',
};
}
},
},
watch: {
@@ -73,14 +73,14 @@ export default createComponent({
areaList: {
deep: true,
handler: 'setValues'
handler: 'setValues',
},
columnsNum() {
this.$nextTick(() => {
this.setValues();
});
}
},
},
mounted() {
@@ -98,7 +98,7 @@ export default createComponent({
const list = this[type];
result = Object.keys(list).map(listCode => ({
code: listCode,
name: list[listCode]
name: list[listCode],
}));
if (code) {
@@ -121,7 +121,7 @@ export default createComponent({
result.unshift({
code: `${code}${codeFill}`,
name: this.placeholderMap[type]
name: this.placeholderMap[type],
});
}
@@ -218,7 +218,7 @@ export default createComponent({
picker.setIndexes([
this.getIndex('province', code),
this.getIndex('city', code),
this.getIndex('county', code)
this.getIndex('county', code),
]);
},
@@ -236,7 +236,7 @@ export default createComponent({
country: '',
province: '',
city: '',
county: ''
county: '',
};
if (!values.length) {
@@ -266,14 +266,14 @@ export default createComponent({
reset(code) {
this.code = code || '';
this.setValues();
}
},
},
render() {
const on = {
...this.$listeners,
change: this.onChange,
confirm: this.onConfirm
confirm: this.onConfirm,
};
return (
@@ -293,5 +293,5 @@ export default createComponent({
{...{ on }}
/>
);
}
},
});
+18 -18
View File
@@ -5,13 +5,13 @@ import { mount, later, triggerDrag } from '../../../test';
const firstOption = [
{ code: '110000', name: '北京市' },
{ code: '110100', name: '北京市' },
{ code: '110101', name: '东城区' }
{ code: '110101', name: '东城区' },
];
const secondOption = [
{ code: '120000', name: '天津市' },
{ code: '120100', name: '天津市' },
{ code: '120101', name: '和平区' }
{ code: '120101', name: '和平区' },
];
test('confirm & cancel event', async () => {
@@ -19,12 +19,12 @@ test('confirm & cancel event', async () => {
const onCancel = jest.fn();
const wrapper = mount(Area, {
propsData: {
areaList
areaList,
},
listeners: {
confirm: onConfirm,
cancel: onCancel
}
cancel: onCancel,
},
});
await later();
@@ -39,8 +39,8 @@ test('confirm & cancel event', async () => {
test('watch areaList & code', async () => {
const wrapper = mount(Area, {
propsData: {
areaList
}
areaList,
},
});
expect(wrapper).toMatchSnapshot();
@@ -50,7 +50,7 @@ test('watch areaList & code', async () => {
expect(wrapper).toMatchSnapshot();
wrapper.setProps({
value: ''
value: '',
});
expect(wrapper).toMatchSnapshot();
});
@@ -59,11 +59,11 @@ test('change option', () => {
const onChange = jest.fn();
const wrapper = mount(Area, {
propsData: {
areaList
areaList,
},
listeners: {
change: onChange
}
change: onChange,
},
});
const columns = wrapper.findAll('.van-picker-column');
@@ -83,11 +83,11 @@ test('change option', () => {
test('getValues method', () => {
const wrapper = mount(Area, {
propsData: {
areaList
areaList,
},
created() {
expect(this.getValues()).toEqual([]);
}
},
});
expect(wrapper.vm.getValues()).toEqual(firstOption);
@@ -97,8 +97,8 @@ test('reset method', async () => {
const wrapper = mount(Area, {
propsData: {
areaList,
value: '120225'
}
value: '120225',
},
});
await later();
@@ -111,12 +111,12 @@ test('columns-num prop', async () => {
const wrapper = mount(Area, {
propsData: {
areaList,
columnsNum: 3
}
columnsNum: 3,
},
});
wrapper.setProps({
columnsNum: 2
columnsNum: 2,
});
await later();