From 40abb2a8dc5d98f93020ebb5086ef9894fbfe4c3 Mon Sep 17 00:00:00 2001 From: zhouxinyong Date: Fri, 29 Jul 2022 14:50:45 +0800 Subject: [PATCH] fix: children not show in FormGrid --- docs/demos/guide/form-grid/native.vue | 1 - packages/components/src/form-grid/index.ts | 38 +++++++++------------- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/docs/demos/guide/form-grid/native.vue b/docs/demos/guide/form-grid/native.vue index 5e6f588..177139b 100644 --- a/docs/demos/guide/form-grid/native.vue +++ b/docs/demos/guide/form-grid/native.vue @@ -145,7 +145,6 @@ import { FormGrid } from '@formily/antdv-x3' const Cell = (props, { slots }) => { - console.log(props) return (
>, }, }, - setup(props) { + setup(props, { slots }) { const layout = useFormLayout() const gridInstance = computed(() => { @@ -126,31 +126,23 @@ const FormGridInner = observer( }) }) - return { - prefixCls, - root, - gridInstance, - } - }, - render() { - const { prefixCls, gridInstance } = this - return h( - 'div', - { - class: `${prefixCls}`, - style: { - gridTemplateColumns: gridInstance.templateColumns, - gap: gridInstance.gap, + return () => { + return h( + 'div', + { + class: `${prefixCls}`, + style: { + gridTemplateColumns: gridInstance.value.templateColumns, + gap: gridInstance.value.gap, + }, + ref: root, }, - ref: 'root', - }, - { - default: () => this.$slots.default, - } - ) + slots + ) + } }, }) -) as any +) const FormGridColumn = observer( // eslint-disable-next-line vue/one-component-per-file