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 => {