chore: prefer arrow function shorthand

This commit is contained in:
chenjiahan
2021-03-02 17:45:12 +08:00
parent 2fd0d54da1
commit a0addef294
42 changed files with 98 additions and 249 deletions
+4 -14
View File
@@ -83,24 +83,14 @@ export default createComponent({
label={express.address}
class={bem('search-item')}
border={false}
onClick={() => {
onSelect(express);
}}
onClick={() => onSelect(express)}
/>
));
};
const onFocus = (event: Event) => {
emit('focus', event);
};
const onBlur = (event: Event) => {
emit('blur', event);
};
const onInput = (value: string) => {
emit('input', value);
};
const onBlur = (event: Event) => emit('blur', event);
const onFocus = (event: Event) => emit('focus', event);
const onInput = (value: string) => emit('input', value);
return () => {
if (props.show) {
+5 -15
View File
@@ -239,12 +239,8 @@ export default createComponent({
Dialog.confirm({
title: t('confirmDelete'),
})
.then(() => {
emit('delete', state.data);
})
.catch(() => {
emit('cancel-delete', state.data);
});
.then(() => emit('delete', state.data))
.catch(() => emit('cancel-delete', state.data));
};
// get values of area component
@@ -277,9 +273,7 @@ export default createComponent({
<Switch
v-model={state.data.isDefault}
size="24"
onChange={(event) => {
emit('change-default', event);
}}
onChange={(event) => emit('change-default', event)}
/>
),
};
@@ -306,9 +300,7 @@ export default createComponent({
watch(
() => props.areaList,
() => {
setAreaCode(state.data.areaCode);
}
() => setAreaCode(state.data.areaCode)
);
watch(
@@ -378,9 +370,7 @@ export default createComponent({
onBlur={onDetailBlur}
onFocus={() => onFocus('addressDetail')}
onInput={onChangeDetail}
onSelect-search={(event: Event) => {
emit('select-search', event);
}}
onSelect-search={(event: Event) => emit('select-search', event)}
/>
{props.showPostal && (
<Field