mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 10:20:19 +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 & {
|
export type NotifyProps = PopupMixinProps & {
|
||||||
type: 'primary' | 'success' | 'danger' | 'warning';
|
type: 'primary' | 'success' | 'danger' | 'warning';
|
||||||
color: string;
|
color: string;
|
||||||
message: string | number;
|
message: number | string;
|
||||||
duration: number;
|
duration: number | string;
|
||||||
className?: any;
|
className?: any;
|
||||||
background: string;
|
background: string;
|
||||||
};
|
};
|
||||||
@ -54,18 +54,15 @@ function Notify(
|
|||||||
Notify.props = {
|
Notify.props = {
|
||||||
...popupMixinProps,
|
...popupMixinProps,
|
||||||
color: String,
|
color: String,
|
||||||
background: String,
|
|
||||||
className: null as any,
|
|
||||||
message: [Number, String],
|
message: [Number, String],
|
||||||
|
duration: [Number, String],
|
||||||
|
className: null as any,
|
||||||
|
background: String,
|
||||||
getContainer: [String, Function],
|
getContainer: [String, Function],
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'danger',
|
default: 'danger',
|
||||||
},
|
},
|
||||||
duration: {
|
|
||||||
type: Number,
|
|
||||||
default: 3000,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default createComponent<NotifyProps>(Notify);
|
export default createComponent<NotifyProps>(Notify);
|
||||||
|
@ -70,7 +70,7 @@ export default {
|
|||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| type `v2.1.6` | Can be set to `primary` `success` `warning` | *string* | `danger` |
|
| type `v2.1.6` | Can be set to `primary` `success` `warning` | *string* | `danger` |
|
||||||
| message | Message | *string* | - |
|
| 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` | |
|
| color | Message color | *string* | `#fff` | |
|
||||||
| background | Background color | *string* | - |
|
| background | Background color | *string* | - |
|
||||||
| className | Custom className | *any* | - |
|
| className | Custom className | *any* | - |
|
||||||
|
@ -81,7 +81,7 @@ export default {
|
|||||||
|------|------|------|------|
|
|------|------|------|------|
|
||||||
| type `v2.1.6` | 类型,可选值为 `primary` `success` `warning` | *string* | `danger` |
|
| type `v2.1.6` | 类型,可选值为 `primary` `success` `warning` | *string* | `danger` |
|
||||||
| message | 展示文案,支持通过`\n`换行 | *string* | - |
|
| message | 展示文案,支持通过`\n`换行 | *string* | - |
|
||||||
| duration | 展示时长(ms),值为 0 时,notify 不会消失 | *number* | `3000` |
|
| duration | 展示时长(ms),值为 0 时,notify 不会消失 | *number \| string* | `3000` |
|
||||||
| color | 字体颜色 | *string* | `#fff` |
|
| color | 字体颜色 | *string* | `#fff` |
|
||||||
| background | 背景颜色 | *string* | - |
|
| background | 背景颜色 | *string* | - |
|
||||||
| className | 自定义类名 | *any* | - |
|
| className | 自定义类名 | *any* | - |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user