From f64b267ee92172ec0b25d8b2c19294360b83ed5e Mon Sep 17 00:00:00 2001 From: FairyEver <1711467488@qq.com> Date: Mon, 8 Jun 2020 15:28:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20jsx=20=E9=87=8D=E5=86=99?= =?UTF-8?q?=20d2-container=20=E7=9A=84=20render?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/d2-container/index.js | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) 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 ? : null, + this.$slots.footer ? : null + ] + return
+ this.$emit('scroll', e) }> + { slots } + + +
}, methods: { // 返回顶部