fixed #1881
This commit is contained in:
parent
a87597bfe7
commit
36a9157947
3 changed files with 19 additions and 5 deletions
|
@ -38,10 +38,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.$Message.config({
|
// this.$Message.config({
|
||||||
top: 50,
|
// top: 50,
|
||||||
duration: 3
|
// duration: 3
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<transition :name="transitionName">
|
<transition :name="transitionName" @enter="handleEnter" @leave="handleLeave">
|
||||||
<div :class="classes" :style="styles">
|
<div :class="classes" :style="styles">
|
||||||
<template v-if="type === 'notice'">
|
<template v-if="type === 'notice'">
|
||||||
<div :class="[baseClass + '-content']" ref="content" v-html="content"></div>
|
<div :class="[baseClass + '-content']" ref="content" v-html="content"></div>
|
||||||
|
@ -96,6 +96,18 @@
|
||||||
this.clearCloseTimer();
|
this.clearCloseTimer();
|
||||||
this.onClose();
|
this.onClose();
|
||||||
this.$parent.close(this.name);
|
this.$parent.close(this.name);
|
||||||
|
},
|
||||||
|
handleEnter (el) {
|
||||||
|
if (this.type === 'message') {
|
||||||
|
el.style.height = el.scrollHeight + 'px';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleLeave (el) {
|
||||||
|
if (this.type === 'message') {
|
||||||
|
el.style.height = 0;
|
||||||
|
el.style.paddingTop = 0;
|
||||||
|
el.style.paddingBottom = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|
|
@ -13,6 +13,8 @@
|
||||||
&-notice {
|
&-notice {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
transition: height @animation-time @ease-in-out, padding @animation-time @ease-in-out;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
margin-top: -8px;
|
margin-top: -8px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue