king
2021-01-15 40436544f55558d2c8d1c14c68cce79546c60dff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import 'braft-editor/dist/index.css'
import 'braft-extensions/dist/table.css'
import BraftEditor from 'braft-editor'
import Table from 'braft-extensions/dist/table'
 
import './index.scss'
 
BraftEditor.use(Table())
 
class NormalEditor extends Component {
  static propTpyes = {
    card: PropTypes.object,  // 条码设置
    value: PropTypes.any,    // 条码值
  }
 
  shouldComponentUpdate (nextProps, nextState) {
    return !is(fromJS(this.props), fromJS(nextProps))
  }
 
  handleEditorChange = () => {
 
  }
 
  submitContent = () => {
 
  }
 
  render() {
 
    return (
      <div className="normal-braft-editor">
        <BraftEditor value={'<p></p>'} onChange={this.handleEditorChange} onSave={this.submitContent}/>
      </div>
    )
  }
}
 
export default NormalEditor