feat: 添加i18n,美化界面
This commit is contained in:
17
packages/codemirror/src/pages/file-editor/FileEditor.tsx
Normal file
17
packages/codemirror/src/pages/file-editor/FileEditor.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { BaseEditor } from '../../editor/editor';
|
||||
|
||||
export const FileEditor = () => {
|
||||
const containerRef = useRef<HTMLDivElement>(null);
|
||||
useEffect(() => {
|
||||
const editor = new BaseEditor();
|
||||
if (containerRef.current) {
|
||||
editor.createEditor(containerRef.current);
|
||||
}
|
||||
return () => {
|
||||
editor.destroyEditor();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return <div ref={containerRef} className='w-full h-full'></div>;
|
||||
};
|
||||
Reference in New Issue
Block a user