diff --git a/src/components/d2-container/index.js b/src/components/d2-container/index.js index 18768d85..ccde1ade 100644 --- a/src/components/d2-container/index.js +++ b/src/components/d2-container/index.js @@ -38,22 +38,22 @@ export default { } }, render (h) { - const slots = [this.$slots.default] - if (this.$slots.header) slots.push(h('template', { slot: 'header' }, [this.$slots.header])) - if (this.$slots.footer) slots.push(h('template', { slot: 'footer' }, [this.$slots.footer])) - return h('div', { - ref: 'container', - class: 'container-component' - }, [ - h(this.component, { - ref: 'component', - props: this.$attrs, - on: { - scroll: e => this.$emit('scroll', e) - } - }, slots), - h(d2Source) - ]) + const slots = [ + this.$slots.default, + this.$slots.header ? { this.$slots.header } : null, + this.$slots.footer ? { this.$slots.footer } : null + ] + return