import MarkdownEditor from '@uiw/react-markdown-editor'; import cx from 'classnames'; import React from 'react'; import type { StdCallback } from './types'; const CLASS_NAME = 'ac-markdown-editor'; export type AcMarkdownEditorProps = { className?: string; value?: string; onChange?: StdCallback; } & React.ComponentProps; export class AcMarkdownEditor extends React.Component { static displayName = CLASS_NAME; static formSchema = CLASS_NAME; static defaultProps = {}; handleChange = (inValue: string) => { const { onChange } = this.props; onChange?.({ target: { value: inValue } }); }; render() { const { className, value, onChange, ...props } = this.props; // 确保 value 不是 null 或 undefined const safeValue = value ?? ''; return ( ); } } export const AcMarkdownEditorFc = (props: AcMarkdownEditorProps) => { return ; };