Commit e7ad4154325f807f546866e2d666450796677f47
1 parent
297648f1
update Message style #1881
Showing
2 changed files
with
7 additions
and
4 deletions
Show diff stats
examples/routers/message.vue
src/components/base/notification/notice.vue
| ... | ... | @@ -104,9 +104,12 @@ |
| 104 | 104 | }, |
| 105 | 105 | handleLeave (el) { |
| 106 | 106 | if (this.type === 'message') { |
| 107 | - el.style.height = 0; | |
| 108 | - el.style.paddingTop = 0; | |
| 109 | - el.style.paddingBottom = 0; | |
| 107 | + // 优化一下,如果当前只有一个 Message,则不使用 js 过渡动画,这样更优美 | |
| 108 | + if (document.getElementsByClassName('ivu-message-notice').length !== 1) { | |
| 109 | + el.style.height = 0; | |
| 110 | + el.style.paddingTop = 0; | |
| 111 | + el.style.paddingBottom = 0; | |
| 112 | + } | |
| 110 | 113 | } |
| 111 | 114 | } |
| 112 | 115 | }, | ... | ... |