mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-08-07 04:59:46 +08:00
[new feature] Notify: add className prop (#2681)
This commit is contained in:
parent
ca4e476ddd
commit
3578defd11
@ -8,10 +8,10 @@ export default sfc({
|
|||||||
mixins: [Popup],
|
mixins: [Popup],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
className: null,
|
||||||
title: String,
|
title: String,
|
||||||
message: String,
|
message: String,
|
||||||
callback: Function,
|
callback: Function,
|
||||||
className: [String, Object, Array],
|
|
||||||
beforeClose: Function,
|
beforeClose: Function,
|
||||||
messageAlign: String,
|
messageAlign: String,
|
||||||
confirmButtonText: String,
|
confirmButtonText: String,
|
||||||
|
@ -19,11 +19,11 @@ export default sfc({
|
|||||||
|
|
||||||
props: {
|
props: {
|
||||||
images: Array,
|
images: Array,
|
||||||
|
className: null,
|
||||||
lazyLoad: Boolean,
|
lazyLoad: Boolean,
|
||||||
asyncClose: Boolean,
|
asyncClose: Boolean,
|
||||||
startPosition: Number,
|
startPosition: Number,
|
||||||
showIndicators: Boolean,
|
showIndicators: Boolean,
|
||||||
className: [String, Object, Array],
|
|
||||||
loop: {
|
loop: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
@ -8,6 +8,7 @@ export default sfc({
|
|||||||
mixins: [PopupMixin],
|
mixins: [PopupMixin],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
className: null,
|
||||||
message: [String, Number],
|
message: [String, Number],
|
||||||
color: {
|
color: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -34,7 +35,7 @@ export default sfc({
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<transition name="van-slide-down">
|
<transition name="van-slide-down">
|
||||||
<div vShow={this.value} class={bem()} style={style}>
|
<div vShow={this.value} class={[bem(), this.className]} style={style}>
|
||||||
{this.message}
|
{this.message}
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
@ -55,3 +55,4 @@ export default {
|
|||||||
| duration | Duration(ms), won't disappear if value is 0 | `Number` | `3000` |
|
| duration | Duration(ms), won't disappear if value is 0 | `Number` | `3000` |
|
||||||
| color | Message color | `String` | `#fff` | |
|
| color | Message color | `String` | `#fff` | |
|
||||||
| background | Background color | `String` | `#f44` |
|
| background | Background color | `String` | `#f44` |
|
||||||
|
| className | Custom className | `String | Array | Object` | - |
|
||||||
|
@ -52,7 +52,8 @@ Notify.defaultOptions = {
|
|||||||
text: '',
|
text: '',
|
||||||
color: WHITE,
|
color: WHITE,
|
||||||
background: RED,
|
background: RED,
|
||||||
duration: 3000
|
duration: 3000,
|
||||||
|
className: ''
|
||||||
};
|
};
|
||||||
|
|
||||||
Notify.setDefaultOptions = options => {
|
Notify.setDefaultOptions = options => {
|
||||||
|
@ -54,3 +54,4 @@ export default {
|
|||||||
| duration | 展示时长(ms),值为 0 时,notify 不会消失 | `Number` | `3000` | 1.4.7 |
|
| duration | 展示时长(ms),值为 0 时,notify 不会消失 | `Number` | `3000` | 1.4.7 |
|
||||||
| color | 字体颜色 | `String` | `#fff` | 1.4.7 |
|
| color | 字体颜色 | `String` | `#fff` | 1.4.7 |
|
||||||
| background | 背景颜色 | `String` | `#f44` | 1.4.7 |
|
| background | 背景颜色 | `String` | `#f44` | 1.4.7 |
|
||||||
|
| className | 自定义类名 | `String | Array | Object` | - | 1.6.0 |
|
||||||
|
@ -5,8 +5,8 @@ const [sfc, bem] = use('overlay');
|
|||||||
export default sfc({
|
export default sfc({
|
||||||
props: {
|
props: {
|
||||||
zIndex: Number,
|
zIndex: Number,
|
||||||
|
className: null,
|
||||||
visible: Boolean,
|
visible: Boolean,
|
||||||
className: String,
|
|
||||||
customStyle: Object
|
customStyle: Object
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ export default sfc({
|
|||||||
mixins: [Popup],
|
mixins: [Popup],
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
className: String,
|
className: null,
|
||||||
forbidClick: Boolean,
|
forbidClick: Boolean,
|
||||||
message: [String, Number],
|
message: [String, Number],
|
||||||
type: {
|
type: {
|
||||||
|
@ -102,3 +102,4 @@ toast2.clear();
|
|||||||
| forbidClick | 是否禁止背景点击 | `Boolean` | `false` | - |
|
| forbidClick | 是否禁止背景点击 | `Boolean` | `false` | - |
|
||||||
| loadingType | 加载图标类型, 可选值为 `spinner` | `String` | `circular` | 1.1.3 |
|
| loadingType | 加载图标类型, 可选值为 `spinner` | `String` | `circular` | 1.1.3 |
|
||||||
| duration | 展示时长(ms),值为 0 时,toast 不会消失 | `Number` | `3000` | - |
|
| duration | 展示时长(ms),值为 0 时,toast 不会消失 | `Number` | `3000` | - |
|
||||||
|
| className | 自定义类名 | `String | Array | Object` | - | 1.6.0 |
|
||||||
|
3
types/notify.d.ts
vendored
3
types/notify.d.ts
vendored
@ -5,8 +5,9 @@ type NotifyMessage = string | number;
|
|||||||
export type NotifyOptions = {
|
export type NotifyOptions = {
|
||||||
message?: NotifyMessage;
|
message?: NotifyMessage;
|
||||||
color?: string;
|
color?: string;
|
||||||
background?: string;
|
|
||||||
duration?: number;
|
duration?: number;
|
||||||
|
className?: any;
|
||||||
|
background?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VanNotify extends Vue {
|
export interface VanNotify extends Vue {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user