[new feature] Notify: add className prop (#2681)
This commit is contained in:
@@ -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 (
|
||||
<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}
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
@@ -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` | - |
|
||||
|
||||
@@ -52,7 +52,8 @@ Notify.defaultOptions = {
|
||||
text: '',
|
||||
color: WHITE,
|
||||
background: RED,
|
||||
duration: 3000
|
||||
duration: 3000,
|
||||
className: ''
|
||||
};
|
||||
|
||||
Notify.setDefaultOptions = options => {
|
||||
|
||||
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user