Closed Ellen0604 closed 3 months ago
@Ellen0604 Upgrade v4.0.4
我添加了国际方法,这可能是我目前想到最简单的办法,同时不增加打包后的体积,同时方便使用
import React, { useContext } from "react";
import MDEditor, { commands } from "@uiw/react-md-editor";
import { getCommands, getExtraCommands } from "@uiw/react-md-editor/commands-cn";
export default function App() {
const [value, setValue] = React.useState("**Hello world!!!**");
return (
<MDEditor
value={value}
preview="edit"
commands={[...getCommands()]}
extraCommands={[...getExtraCommands()]}
onChange={(val) => setValue(val)}
/>
);
}
十分感谢