Commit e7ad4154325f807f546866e2d666450796677f47

Authored by 梁灏
1 parent 297648f1

update Message style #1881

examples/routers/message.vue
... ... @@ -16,7 +16,7 @@
16 16 content: '这是一条普通提示2',
17 17 duration: 500,
18 18 onClose () {
19   - console.log(123)
  19 +// console.log(123)
20 20 },
21 21 closable: true
22 22 })
... ...
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 },
... ...