From 3578defd110b0b8461959a2793901563da0ec639 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 4 Feb 2019 10:13:00 +0800 Subject: [PATCH] [new feature] Notify: add className prop (#2681) --- packages/dialog/Dialog.js | 2 +- packages/image-preview/ImagePreview.js | 2 +- packages/notify/Notify.js | 3 ++- packages/notify/en-US.md | 1 + packages/notify/index.js | 3 ++- packages/notify/zh-CN.md | 1 + packages/overlay/index.js | 2 +- packages/toast/Toast.js | 2 +- packages/toast/zh-CN.md | 1 + types/notify.d.ts | 3 ++- 10 files changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/dialog/Dialog.js b/packages/dialog/Dialog.js index 1841a90f4..13c7dff84 100644 --- a/packages/dialog/Dialog.js +++ b/packages/dialog/Dialog.js @@ -8,10 +8,10 @@ export default sfc({ mixins: [Popup], props: { + className: null, title: String, message: String, callback: Function, - className: [String, Object, Array], beforeClose: Function, messageAlign: String, confirmButtonText: String, diff --git a/packages/image-preview/ImagePreview.js b/packages/image-preview/ImagePreview.js index a39dd3a31..019ccbbbd 100644 --- a/packages/image-preview/ImagePreview.js +++ b/packages/image-preview/ImagePreview.js @@ -19,11 +19,11 @@ export default sfc({ props: { images: Array, + className: null, lazyLoad: Boolean, asyncClose: Boolean, startPosition: Number, showIndicators: Boolean, - className: [String, Object, Array], loop: { type: Boolean, default: true diff --git a/packages/notify/Notify.js b/packages/notify/Notify.js index 3db1b94b5..4be792cdf 100644 --- a/packages/notify/Notify.js +++ b/packages/notify/Notify.js @@ -8,6 +8,7 @@ export default sfc({ mixins: [PopupMixin], props: { + className: null, message: [String, Number], color: { type: String, @@ -34,7 +35,7 @@ export default sfc({ }; return ( -
+
{this.message}
diff --git a/packages/notify/en-US.md b/packages/notify/en-US.md index 949a28358..4b1c6a43a 100644 --- a/packages/notify/en-US.md +++ b/packages/notify/en-US.md @@ -55,3 +55,4 @@ export default { | duration | Duration(ms), won't disappear if value is 0 | `Number` | `3000` | | color | Message color | `String` | `#fff` | | | background | Background color | `String` | `#f44` | +| className | Custom className | `String | Array | Object` | - | diff --git a/packages/notify/index.js b/packages/notify/index.js index 428f5c411..ed732205d 100644 --- a/packages/notify/index.js +++ b/packages/notify/index.js @@ -52,7 +52,8 @@ Notify.defaultOptions = { text: '', color: WHITE, background: RED, - duration: 3000 + duration: 3000, + className: '' }; Notify.setDefaultOptions = options => { diff --git a/packages/notify/zh-CN.md b/packages/notify/zh-CN.md index 5846721f6..58aa99e0a 100644 --- a/packages/notify/zh-CN.md +++ b/packages/notify/zh-CN.md @@ -54,3 +54,4 @@ export default { | duration | 展示时长(ms),值为 0 时,notify 不会消失 | `Number` | `3000` | 1.4.7 | | color | 字体颜色 | `String` | `#fff` | 1.4.7 | | background | 背景颜色 | `String` | `#f44` | 1.4.7 | +| className | 自定义类名 | `String | Array | Object` | - | 1.6.0 | diff --git a/packages/overlay/index.js b/packages/overlay/index.js index 91443b16a..076624205 100644 --- a/packages/overlay/index.js +++ b/packages/overlay/index.js @@ -5,8 +5,8 @@ const [sfc, bem] = use('overlay'); export default sfc({ props: { zIndex: Number, + className: null, visible: Boolean, - className: String, customStyle: Object }, diff --git a/packages/toast/Toast.js b/packages/toast/Toast.js index 365cf25d6..88c035c10 100644 --- a/packages/toast/Toast.js +++ b/packages/toast/Toast.js @@ -10,7 +10,7 @@ export default sfc({ mixins: [Popup], props: { - className: String, + className: null, forbidClick: Boolean, message: [String, Number], type: { diff --git a/packages/toast/zh-CN.md b/packages/toast/zh-CN.md index db2a3000b..31e88391f 100644 --- a/packages/toast/zh-CN.md +++ b/packages/toast/zh-CN.md @@ -102,3 +102,4 @@ toast2.clear(); | forbidClick | 是否禁止背景点击 | `Boolean` | `false` | - | | loadingType | 加载图标类型, 可选值为 `spinner` | `String` | `circular` | 1.1.3 | | duration | 展示时长(ms),值为 0 时,toast 不会消失 | `Number` | `3000` | - | +| className | 自定义类名 | `String | Array | Object` | - | 1.6.0 | diff --git a/types/notify.d.ts b/types/notify.d.ts index e7ead0335..a647e13ac 100644 --- a/types/notify.d.ts +++ b/types/notify.d.ts @@ -5,8 +5,9 @@ type NotifyMessage = string | number; export type NotifyOptions = { message?: NotifyMessage; color?: string; - background?: string; duration?: number; + className?: any; + background?: string; } export interface VanNotify extends Vue {