Commit f8cb45b3 authored by 杨子龙's avatar 杨子龙

- 增加自定义组件传入

parent 3bf8eda9
......@@ -7,7 +7,7 @@
import React, { useMemo, useContext, forwardRef, useImperativeHandle, useState, useEffect } from 'react'
import FormRender, { useForm } from 'form-render'
import { ConfigProvider, Spin } from 'antd'
import widgets from '../widgets'
import baseWidgets from '../widgets'
import { isObject, getFieldInfo } from '../../utils'
import { getWatch } from './watch'
import styles from '../../main.less'
......@@ -28,7 +28,7 @@ const XRender = (props, ref) => {
}
))
const { schemaValues, disabledFields, disabled, codes, env, firstCall } = props
const { schemaValues, disabledFields, disabled, codes, env, firstCall , widgets = {} } = props
window.pandaXform = {
codes,
env,
......@@ -184,6 +184,13 @@ const XRender = (props, ref) => {
window.tableLocal = []
}, [])
const widgetsObj = {
...baseWidgets,
...widgets
}
console.log(widgets);
return (
<div className={styles.formRender}>
<FormRender
......@@ -194,7 +201,7 @@ const XRender = (props, ref) => {
mapping={{
object: 'Header',
}}
widgets={widgets}
widgets={widgetsObj}
watch={watch}
onMount={onMount}
/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment