项目作者: afeiship

项目描述 :
A lite rich editor based on draft-js(React).
高级语言: JavaScript
项目地址: git://github.com/afeiship/react-rce-draftjs.git
创建时间: 2016-12-02T02:21:19Z
项目社区:https://github.com/afeiship/react-rce-draftjs

开源协议:MIT License

下载


react-rce-draftjs

A lite rich editor based on draftJs(React)

properties:

  1. static propTypes = {
  2. className: PropTypes.string,
  3. value: PropTypes.object,
  4. onChange: PropTypes.func
  5. };
  6. static defaultProps = {
  7. value: null,
  8. onChange: noop
  9. };

install && import:

  1. npm install --save afeiship/react-rce-draftjs --registry=https://registry.npm.taobao.org
  1. import ReactRceDraftjs from 'react-rce-draftjs';
  1. // customize your styles:
  2. $react-rce-draftjs-options:(
  3. );
  4. @import 'node_modules/react-rce-draftjs/dist/style.scss';

usage:

  1. // install: npm install afeiship/react-rce-draftjs --save
  2. // import : import ReactRceDraftjs from 'react-rce-draftjs'
  3. class App extends React.Component{
  4. state = {
  5. };
  6. constructor(props){
  7. super(props);
  8. window.demo = this;
  9. window.refs = this.refs;
  10. window.rc = this.refs.rc;
  11. }
  12. render(){
  13. return (
  14. <div className="hello-react-rce-draftjs">
  15. <ReactRceDraftjs ref='rc' ></ReactRceDraftjs>
  16. </div>
  17. );
  18. }
  19. }