update $Message

This commit is contained in:
梁灏 2019-09-06 09:34:52 +08:00
parent e7da556669
commit 6503055954
4 changed files with 9 additions and 2 deletions

View file

@ -14,7 +14,8 @@
info () { info () {
this.$Message.info({ this.$Message.info({
content: '这是一条普通的提示', content: '这是一条普通的提示',
duration: 1000 duration: 1000,
background: true
}); });
}, },
success () { success () {

View file

@ -83,6 +83,9 @@
background: { background: {
type: Boolean, type: Boolean,
default: false default: false
},
msgType: {
type: String
} }
}, },
data () { data () {
@ -103,7 +106,8 @@
{ {
[`${this.className}`]: !!this.className, [`${this.className}`]: !!this.className,
[`${this.baseClass}-closable`]: this.closable, [`${this.baseClass}-closable`]: this.closable,
[`${this.baseClass}-with-desc`]: this.withDesc [`${this.baseClass}-with-desc`]: this.withDesc,
[`${this.baseClass}-with-background`]: this.background
} }
]; ];
}, },

View file

@ -15,6 +15,7 @@
:name="notice.name" :name="notice.name"
:transition-name="notice.transitionName" :transition-name="notice.transitionName"
:background="notice.background" :background="notice.background"
:msg-type="notice.msgType"
:on-close="notice.onClose"> :on-close="notice.onClose">
</Notice> </Notice>
</div> </div>

View file

@ -54,6 +54,7 @@ function notice (content = '', duration = defaults.duration, type, onClose = fun
onClose: onClose, onClose: onClose,
closable: closable, closable: closable,
type: 'message', type: 'message',
msgType: type,
background: background background: background
}); });