import SealInput from '@/components/seal-form/seal-input'; import { PageActionType } from '@/config/types'; import YamlEditor from '@/pages/_components/yaml-editor'; import { useIntl } from '@umijs/max'; import { Form } from 'antd'; import React, { forwardRef, useImperativeHandle } from 'react'; import ProxyConfig from './proxy-config'; const AdvanceConfig: React.FC<{ action: PageActionType; ref?: any; }> = forwardRef(({ action }, ref) => { const form = Form.useFormInstance(); const intl = useIntl(); const editorRef = React.useRef(null); const [fileContent, setFileContent] = React.useState(''); useImperativeHandle(ref, () => ({ getYamlValue: () => { return editorRef.current?.getValue(); }, setYamlValue: (values: any) => { console.log('setYamlValue:', values); editorRef.current?.setValue(values || ''); } })); return ( <>
{ setFileContent(content); }} > ); }); export default AdvanceConfig;