optimize Notice style when without desc
optimize Notice style when without desc
This commit is contained in:
parent
928033f0bd
commit
034412553a
6 changed files with 169 additions and 59 deletions
|
@ -47,6 +47,11 @@
|
|||
type: String
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
withDesc: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
baseClass () {
|
||||
return `${this.prefixCls}-notice`;
|
||||
|
@ -56,7 +61,8 @@
|
|||
this.baseClass,
|
||||
{
|
||||
[`${this.className}`]: !!this.className,
|
||||
[`${this.baseClass}-closable`]: this.closable
|
||||
[`${this.baseClass}-closable`]: this.closable,
|
||||
[`${this.baseClass}-with-desc`]: this.withDesc
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -85,6 +91,11 @@
|
|||
this.close();
|
||||
}, this.duration * 1000)
|
||||
}
|
||||
|
||||
// check if with desc in Notice component
|
||||
if (this.prefixCls === 'ivu-notice') {
|
||||
this.withDesc = this.$els.content.querySelectorAll(`.${this.prefixCls}-desc`)[0].innerHTML !== '';
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
this.clearCloseTimer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue