https://www.yuque.com/form/reactflow/leva
LevaPanenl 属性配置 https://pro-editor.antdigital.dev/components/leva-panel
LevaPanel
import { useState } from 'react';
import { LevaPanel } from '@ant-design/pro-editor';
import type { JSONSchema } from '@ant-design/pro-editor';
interface IProps {
schema: JSONSchema;
title: string;
}
function Panel(props: IProps) {
const {
title,
schema
} = props;
const [config, setConfig] = useState<JSONSchema>({});
return (
<LevaPanel
schema={schema}
title={title}
value={config}
onChange={(changedValue, allValue) => {
setConfig(allValue);
console.log('check changedValue:', {changedValue, allValue });
}}
/>
);
}
export default Panel;