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
+9 -9
View File
@@ -53,7 +53,7 @@ export default {
showTitle: '展示标题栏',
showCancel: '展示取消按钮',
showDescription: '展示描述信息',
description: '这是一段描述信息'
description: '这是一段描述信息',
},
'en-US': {
buttonText: 'Show ActionSheet',
@@ -63,8 +63,8 @@ export default {
showTitle: 'ActionSheet with title',
showCancel: 'ActionSheet with cancel button',
showDescription: 'ActionSheet with description',
description: 'Description'
}
description: 'Description',
},
},
data() {
@@ -73,7 +73,7 @@ export default {
show2: false,
show3: false,
show4: false,
show5: false
show5: false,
};
},
@@ -82,7 +82,7 @@ export default {
return [
{ name: this.$t('option') },
{ name: this.$t('option') },
{ name: this.$t('option'), subname: this.$t('subname') }
{ name: this.$t('option'), subname: this.$t('subname') },
];
},
@@ -90,9 +90,9 @@ export default {
return [
{ name: this.$t('option'), color: GREEN },
{ loading: true },
{ name: this.$t('disabledOption'), disabled: true }
{ name: this.$t('disabledOption'), disabled: true },
];
}
},
},
methods: {
@@ -103,8 +103,8 @@ export default {
onCancel() {
this.$toast('cancel');
}
}
},
},
};
</script>
+7 -7
View File
@@ -97,7 +97,7 @@ function ActionSheet(
return [
<span class={bem('name')}>{item.name}</span>,
item.subname && <span class={bem('subname')}>{item.subname}</span>
item.subname && <span class={bem('subname')}>{item.subname}</span>,
];
}
@@ -162,24 +162,24 @@ ActionSheet.props = {
closeOnClickAction: Boolean,
round: {
type: Boolean,
default: true
default: true,
},
closeIcon: {
type: String,
default: 'cross'
default: 'cross',
},
safeAreaInsetBottom: {
type: Boolean,
default: true
default: true,
},
overlay: {
type: Boolean,
default: true
default: true,
},
closeOnClickOverlay: {
type: Boolean,
default: true
}
default: true,
},
};
export default createComponent<ActionSheetProps>(ActionSheet);
+28 -28
View File
@@ -18,15 +18,15 @@ test('callback events', () => {
propsData: {
value: true,
actions,
cancelText: 'Cancel'
cancelText: 'Cancel',
},
context: {
on: {
input: onInput,
cancel: onCancel,
select: onSelect
}
}
select: onSelect,
},
},
});
const options = wrapper.findAll('.van-action-sheet__item');
@@ -58,17 +58,17 @@ test('click overlay and close', async () => {
</div>
`,
components: {
ActionSheet
ActionSheet,
},
data() {
return {
getContainer: () => div
getContainer: () => div,
};
},
methods: {
onInput,
onClickOverlay
}
onClickOverlay,
},
});
await later();
@@ -84,10 +84,10 @@ test('disable lazy-render', () => {
lazyRender: false,
actions: [
{ name: 'Option' },
{ name: 'Option' }
{ name: 'Option' },
],
cancelText: 'Cancel'
}
cancelText: 'Cancel',
},
});
expect(wrapper).toMatchSnapshot();
@@ -97,13 +97,13 @@ test('render title and default slot', () => {
const wrapper = mount(ActionSheet, {
propsData: {
value: true,
title: 'Title'
title: 'Title',
},
scopedSlots: {
default() {
return 'Default';
}
}
},
},
});
expect(wrapper).toMatchSnapshot();
@@ -113,8 +113,8 @@ test('get container', () => {
const wrapper = mount(ActionSheet, {
propsData: {
value: true,
getContainer: 'body'
}
getContainer: 'body',
},
});
expect(wrapper.vm.$el.parentNode).toEqual(document.body);
@@ -126,13 +126,13 @@ test('close-on-click-action prop', () => {
propsData: {
value: true,
actions: [{ name: 'Option' }],
closeOnClickAction: true
closeOnClickAction: true,
},
context: {
on: {
input: onInput
}
}
input: onInput,
},
},
});
const option = wrapper.find('.van-action-sheet__item');
@@ -146,8 +146,8 @@ test('round prop', () => {
propsData: {
value: true,
round: true,
actions: [{ name: 'Option' }]
}
actions: [{ name: 'Option' }],
},
});
expect(wrapper).toMatchSnapshot();
@@ -157,8 +157,8 @@ test('color option', () => {
const wrapper = mount(ActionSheet, {
propsData: {
value: true,
actions: [{ name: 'Option', color: 'red' }]
}
actions: [{ name: 'Option', color: 'red' }],
},
});
expect(wrapper).toMatchSnapshot();
@@ -169,8 +169,8 @@ test('description prop', () => {
propsData: {
value: true,
description: 'This is a description',
actions: [{ name: 'Option' }]
}
actions: [{ name: 'Option' }],
},
});
expect(wrapper).toMatchSnapshot();
@@ -181,8 +181,8 @@ test('close-icon prop', () => {
propsData: {
value: true,
title: 'Title',
closeIcon: 'cross'
}
closeIcon: 'cross',
},
});
expect(wrapper).toMatchSnapshot();