Kendo编辑器反应包装器显示错误

时间:2018-02-09 11:25:24

标签: javascript reactjs kendo-ui kendo-react-ui

我想使用Kendo UI添加编辑器。但我在TypeError: list is undefined

中收到错误node_modules/@progress/kendo-ui/js/editor/plugins/inlineformat.js:422

我使用以下方法安装了库:

npm install --save @progress/kendo-editor-react-wrapper

这是我的组成部分。

import React, { Component } from 'react';
// import PropTypes from 'prop-types';
import { Editor } from '@progress/kendo-editor-react-wrapper';

class SLEditor extends Component {
  constructor(props) {
    super(props);
    this.state = {
      value: ''
    };
  }
  render() {
    return (
      <div>
        <Editor value={this.state.value} height={500} />
      </div>
    );
  }
}

export default SLEditor;

1 个答案:

答案 0 :(得分:0)

只需要一个配置:

        <Editor
          value={this.value}
          height={500}
          tools={[
            'bold',
            'italic',
            'underline',
            'foreColor',
            'insertUnorderedList',
            'insertOrderedList',
            'createTable',
            'addColumnLeft',
            'addColumnRight',
            'addRowAbove',
            'addRowBelow',
            'deleteRow',
            'deleteColumn',
            'justifyLeft',
            'justifyCenter',
            'justifyRight'
          ]}
        />