feat(Notify): duration to be string

This commit is contained in:
陈嘉涵 2020-01-29 15:21:40 +08:00
parent bb5f28e10e
commit 2546ca58b8
3 changed files with 7 additions and 10 deletions

View File

@ -16,8 +16,8 @@ import { PopupMixinProps } from '../mixins/popup/type';
export type NotifyProps = PopupMixinProps & {
type: 'primary' | 'success' | 'danger' | 'warning';
color: string;
message: string | number;
duration: number;
message: number | string;
duration: number | string;
className?: any;
background: string;
};
@ -54,18 +54,15 @@ function Notify(
Notify.props = {
...popupMixinProps,
color: String,
background: String,
className: null as any,
message: [Number, String],
duration: [Number, String],
className: null as any,
background: String,
getContainer: [String, Function],
type: {
type: String,
default: 'danger',
},
duration: {
type: Number,
default: 3000,
},
};
export default createComponent<NotifyProps>(Notify);

View File

@ -70,7 +70,7 @@ export default {
|------|------|------|------|
| type `v2.1.6` | Can be set to `primary` `success` `warning` | *string* | `danger` |
| message | Message | *string* | - |
| duration | Duration(ms), won't disappear if value is 0 | *number* | `3000` |
| duration | Duration(ms), won't disappear if value is 0 | *number \| string* | `3000` |
| color | Message color | *string* | `#fff` | |
| background | Background color | *string* | - |
| className | Custom className | *any* | - |

View File

@ -81,7 +81,7 @@ export default {
|------|------|------|------|
| type `v2.1.6` | 类型,可选值为 `primary` `success` `warning` | *string* | `danger` |
| message | 展示文案,支持通过`\n`换行 | *string* | - |
| duration | 展示时长(ms),值为 0 时notify 不会消失 | *number* | `3000` |
| duration | 展示时长(ms),值为 0 时notify 不会消失 | *number \| string* | `3000` |
| color | 字体颜色 | *string* | `#fff` |
| background | 背景颜色 | *string* | - |
| className | 自定义类名 | *any* | - |