This commit is contained in:
梁灏 2017-09-14 20:10:44 +08:00
parent a87597bfe7
commit 36a9157947
3 changed files with 19 additions and 5 deletions

View file

@ -1,5 +1,5 @@
<template>
<transition :name="transitionName">
<transition :name="transitionName" @enter="handleEnter" @leave="handleLeave">
<div :class="classes" :style="styles">
<template v-if="type === 'notice'">
<div :class="[baseClass + '-content']" ref="content" v-html="content"></div>
@ -96,6 +96,18 @@
this.clearCloseTimer();
this.onClose();
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 () {