Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

工具栏提示如何设置中文 #621

Closed
Ellen0604 opened this issue Mar 12, 2024 · 2 comments
Closed

工具栏提示如何设置中文 #621

Ellen0604 opened this issue Mar 12, 2024 · 2 comments

Comments

@Ellen0604
Copy link

image

@jaywcjlove
Copy link
Member

@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)}
    />
  );
}

@Ellen0604
Copy link
Author

十分感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants