Skip to content

Commit

Permalink
Merge pull request #6 from formilyjs/fix-grid
Browse files Browse the repository at this point in the history
fix: children not show in FormGrid
  • Loading branch information
zhouxinyong authored Jul 29, 2022
2 parents 2471be7 + 40abb2a commit 352ee55
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 24 deletions.
1 change: 0 additions & 1 deletion docs/demos/guide/form-grid/native.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@
import { FormGrid } from '@formily/antdv-x3'
const Cell = (props, { slots }) => {
console.log(props)
return (
<div
style={{
Expand Down
38 changes: 15 additions & 23 deletions packages/components/src/form-grid/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const FormGridInner = observer(
type: Object as PropType<Grid<HTMLElement>>,
},
},
setup(props) {
setup(props, { slots }) {
const layout = useFormLayout()

const gridInstance = computed(() => {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 352ee55

Please sign in to comment.