在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ngs/draft-js-markdown-shortcuts-plugin开源软件地址(OpenSource Url):https://github.com/ngs/draft-js-markdown-shortcuts-plugin开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):draft-js-markdown-shortcuts-pluginA DraftJS plugin for supporting Markdown syntax shortcuts This plugin works with DraftJS Plugins wrapper component. Usagenpm i --save draft-js-markdown-shortcuts-plugin then import from your editor component import createMarkdownShortcutsPlugin from 'draft-js-markdown-shortcuts-plugin'; Exampleimport React, { Component } from 'react';
import Editor from 'draft-js-plugins-editor';
import createMarkdownShortcutsPlugin from 'draft-js-markdown-shortcuts-plugin';
import { EditorState } from 'draft-js';
const plugins = [createMarkdownShortcutsPlugin()];
export default class DemoEditor extends Component {
constructor(props) {
super(props);
this.state = {
editorState: EditorState.createEmpty(),
};
}
onChange = editorState => {
this.setState({
editorState,
});
};
render() {
return <Editor editorState={this.state.editorState} onChange={this.onChange} plugins={plugins} />;
}
} LicenseMIT. See LICENSE |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论