From 1fea9aa31faefce79a788c0c7fb0b1cd393769fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Thu, 14 Feb 2019 20:30:07 +0800 Subject: [PATCH] [bugfix] Dialog: missing animation when first rendered --- packages/collapse-item/index.js | 19 +++++++++---------- packages/dialog/index.js | 6 +++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/collapse-item/index.js b/packages/collapse-item/index.js index 3b93c95a8..bb650378b 100644 --- a/packages/collapse-item/index.js +++ b/packages/collapse-item/index.js @@ -114,17 +114,16 @@ export default sfc({ }, render(h) { - const titleSlots = CELL_SLOTS.reduce( - (slots, name) => { - if (this.slots(name)) { - slots[name] = () => this.slots(name); - } - return slots; - }, - { - default: () => this.slots('value') + const titleSlots = CELL_SLOTS.reduce((slots, name) => { + if (this.slots(name)) { + slots[name] = () => this.slots(name); } - ); + return slots; + }, {}); + + if (this.slots('value')) { + titleSlots.default = this.slots('value'); + } const Title = ( { instance = new (Vue.extend(VanDialog))({ - el: document.createElement('div') + el: document.createElement('div'), + // avoid missing animation when first rendered + propsData: { + lazyRender: false + } }); instance.$on('input', value => {