mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(Notify): duration to be string
This commit is contained in:
parent
bb5f28e10e
commit
2546ca58b8
@ -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);
|
||||
|
@ -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* | - |
|
||||
|
@ -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* | - |
|
||||
|
Loading…
x
Reference in New Issue
Block a user