1234567891011121314151617181920212223 |
- import React, { Component } from 'react';
- import './index.less';
- export default class Editor extends Component {
- componentWillMount() {
- const { onChange } = this.props;
- setTimeout(() => {
- const editor = CKEDITOR.replace('editor', {
- skin: 'moono',
- toolbarGroups: [{ name: 'clipboard', groups: ['undo', 'clipboard'] }],
- removePlugins: 'pastetext,pastefromword',
- language: 'en',
- });
- editor.on('change', () => {
- if (onChange) onChange(editor.getData());
- });
- }, 1);
- }
- render() {
- return <textarea name="editor" />;
- }
- }
|