mirror of
https://github.com/youzan/vant.git
synced 2026-05-19 01:02:35 +08:00
chore: add trailingComma
This commit is contained in:
@@ -28,7 +28,7 @@ function Notify(
|
||||
) {
|
||||
const style = {
|
||||
color: props.color,
|
||||
background: props.background
|
||||
background: props.background,
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -55,16 +55,16 @@ Notify.props = {
|
||||
getContainer: [String, Function],
|
||||
type: {
|
||||
type: String,
|
||||
default: 'danger'
|
||||
default: 'danger',
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: WHITE
|
||||
default: WHITE,
|
||||
},
|
||||
duration: {
|
||||
type: Number,
|
||||
default: 3000
|
||||
}
|
||||
default: 3000,
|
||||
},
|
||||
};
|
||||
|
||||
export default createComponent<NotifyProps>(Notify);
|
||||
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
notifyType: '通知类型',
|
||||
customColor: '自定义颜色',
|
||||
customNotify: '自定义配置',
|
||||
customDuration: '自定义时长'
|
||||
customDuration: '自定义时长',
|
||||
},
|
||||
'en-US': {
|
||||
primary: 'Primary',
|
||||
@@ -44,8 +44,8 @@ export default {
|
||||
notifyType: 'Notify Type',
|
||||
customColor: 'Custom Color',
|
||||
customNotify: 'Custom Notify',
|
||||
customDuration: 'Custom Duration'
|
||||
}
|
||||
customDuration: 'Custom Duration',
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -57,24 +57,24 @@ export default {
|
||||
this.$notify({
|
||||
message: this.$t('customColor'),
|
||||
color: '#ad0000',
|
||||
background: '#ffe1e1'
|
||||
background: '#ffe1e1',
|
||||
});
|
||||
},
|
||||
|
||||
showCustomDuration() {
|
||||
this.$notify({
|
||||
message: this.$t('customDuration'),
|
||||
duration: 1000
|
||||
duration: 1000,
|
||||
});
|
||||
},
|
||||
|
||||
showType(type) {
|
||||
this.$notify({
|
||||
message: this.$t('content'),
|
||||
type
|
||||
type,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
+4
-4
@@ -35,14 +35,14 @@ function Notify(options: NotifyOptions) {
|
||||
if (instance.onOpened) {
|
||||
instance.onOpened();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
options = {
|
||||
...Notify.currentOptions,
|
||||
...parseOptions(options)
|
||||
...parseOptions(options),
|
||||
};
|
||||
|
||||
Object.assign(instance, options);
|
||||
@@ -66,7 +66,7 @@ function defaultOptions(): NotifyOptions {
|
||||
className: '',
|
||||
onClose: null,
|
||||
onClick: null,
|
||||
onOpened: null
|
||||
onOpened: null,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ test('create a notify', async () => {
|
||||
test('type prop', async () => {
|
||||
const notify = Notify({
|
||||
message: 'test',
|
||||
type: 'primary'
|
||||
type: 'primary',
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -28,7 +28,7 @@ test('notify disappear', async () => {
|
||||
color: 'red',
|
||||
background: 'blue',
|
||||
duration: 10,
|
||||
onClose
|
||||
onClose,
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -40,7 +40,7 @@ test('notify disappear', async () => {
|
||||
|
||||
Notify({
|
||||
message: 'text2',
|
||||
duration: 0
|
||||
duration: 0,
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -63,7 +63,7 @@ test('onClick prop', async () => {
|
||||
const onClick = jest.fn();
|
||||
const notify = Notify({
|
||||
message: 'test',
|
||||
onClick
|
||||
onClick,
|
||||
});
|
||||
|
||||
notify.$el.click();
|
||||
|
||||
Reference in New Issue
Block a user