在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:react-umeditor开源软件地址:https://gitee.com/liuhong1happy/react-umeditor开源软件介绍:react-umeditorReact Editor like Umeditor Installnpm install react-umeditor --save Usejavascript var React = require('react');var Editor = require('react-umeditor');class App extends React.Component { constructor(props){ super(props); this.state = { content: "" } } handleChange(content){ this.setState({ content: content }) } getIcons(){ var icons = [ "source | undo redo | bold italic underline strikethrough fontborder emphasis | ", "paragraph fontfamily fontsize | superscript subscript | ", "forecolor backcolor | removeformat | insertorderedlist insertunorderedlist | selectall | ", "cleardoc | indent outdent | justifyleft justifycenter justifyright | touppercase tolowercase | ", "horizontal date time | image emotion spechars | inserttable" ] return icons; } getPlugins(){ return { "image": { "uploader": { "name":"file", "url": "/api/upload" } } } } render(){ var icons = this.getIcons(); var plugins = this.getPlugins(); return (<Editor ref="editor" icons={icons} value={this.state.content} defaultValue="<p>React Umeditor</p>" onChange={this.handleChange.bind(this)} plugins={plugins} />) }} html <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Editor Demo</title> <!-- mathquill & umeditor stylesheet & if you have the formula icon --> <link rel="stylesheet" href="../../dist/third-part/mathquill/mathquill.css"/> <link rel="stylesheet" href="app.css" type="text/css" /></head><body> <div id="react-container"></div> <!-- jquery & mathquill javascript & if you have the formula icon --> <script src="../../dist/third-part/jquery.min.js"></script> <script src="../../dist/third-part/mathquill/mathquill.js"></script> <!-- your react script --> <script src="bundle.js"></script> <script src="app.js"></script></body></html> ExampleRef FunctionsYou can
PropsYou can set the
IconsSupport icons, As fllow: source undo redo bold italic underline strikethrough fontborder emphasis paragraph fontfamily fontsize superscript subscript forecolor backcolor removeformat insertorderedlist insertunorderedlist selectall cleardoc indent outdent justifyleft justifycenter justifyright touppercase tolowercase horizontal date time image emotion spechars inserttable formula SnapshotDevelop// clone codegit clone https://github.com/liuhong1happy/react-umeditorcd react-umeditor// install requirenpm install// buildnpm run build// run example servercd examplenpm run example Todo - Version 1.0
ContributeChanges and improvements are more than welcome! Feel free to fork and open a pull request. Please make your changes in a specific branch and request to pull into master! If you can, please make sure the editor fully works before sending the PR, as that will help speed up the process. See more document ConcatEmail: [email protected] QQ Group: 247978846 |
请发表评论