React 富文本编辑器

参考网站:https://braft.margox.cn
GitHub:https://github.com/margox/braft-editor

# Install using yarn
yarn add braft-editor
# Install using npm
npm install braft-editor --save

代码引入:

import 'braft-editor/dist/index.css'
import React from 'react'
import BraftEditor from 'braft-editor'

export default class PageDemo extends React.Component {

  state = {
    editorState: BraftEditor.createEditorState(null)
  }

  render () {
    return (
      
    )
  }

  handleChange = (editorState) => {
    this.setState({ editorState })
  }

}

模块配置:
https://braft.margox.cn/demos/basic

你可能感兴趣的:(React 富文本编辑器)