我使用draft-js 在Web 应用程序中显示编辑器。但是我在草稿编辑器中显示文件上传选项时遇到问题。
您可以在此处查看演示https://jpuri.github.io/react-draft-wysiwyg/#/
import React, { Component } from 'react';
import logo from './logo.svg';
import { EditorState } from 'draft-js';
import { Editor } from 'react-draft-wysiwyg';
import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {
editorState: EditorState.createEmpty(),
};
}
onEditorStateChange: Function = (editorState) => {
this.setState({
editorState,
});
};
render() {
const { editorState } = this.state;
return (
<div className="App">
<header className="App-header">
<Editor
editorState={editorState}
toolbarClassName="toolbarClassName"
wrapperClassName="wrapperClassName"
editorClassName="editorClassName"
onEditorStateChange={this.onEditorStateChange}
toolbar={{
inline: …Run Code Online (Sandbox Code Playgroud)