Commit 36a9157947148a0747062137d4555619af32f7ae
1 parent
a87597bf
fixed #1881
Showing
3 changed files
with
19 additions
and
5 deletions
Show diff stats
examples/routers/message.vue
src/components/base/notification/notice.vue
| 1 | 1 | <template> |
| 2 | - <transition :name="transitionName"> | |
| 2 | + <transition :name="transitionName" @enter="handleEnter" @leave="handleLeave"> | |
| 3 | 3 | <div :class="classes" :style="styles"> |
| 4 | 4 | <template v-if="type === 'notice'"> |
| 5 | 5 | <div :class="[baseClass + '-content']" ref="content" v-html="content"></div> |
| ... | ... | @@ -96,6 +96,18 @@ |
| 96 | 96 | this.clearCloseTimer(); |
| 97 | 97 | this.onClose(); |
| 98 | 98 | this.$parent.close(this.name); |
| 99 | + }, | |
| 100 | + handleEnter (el) { | |
| 101 | + if (this.type === 'message') { | |
| 102 | + el.style.height = el.scrollHeight + 'px'; | |
| 103 | + } | |
| 104 | + }, | |
| 105 | + handleLeave (el) { | |
| 106 | + if (this.type === 'message') { | |
| 107 | + el.style.height = 0; | |
| 108 | + el.style.paddingTop = 0; | |
| 109 | + el.style.paddingBottom = 0; | |
| 110 | + } | |
| 99 | 111 | } |
| 100 | 112 | }, |
| 101 | 113 | mounted () { | ... | ... |
src/styles/components/message.less