Quill 工具栏未呈现(显示图标路径而不是呈现)

Quill toolbar is not rendering (icon paths are displayed instead of being rendered)

我正在尝试 运行 React 中的原生 Quill。我遵循 quill 的快速入门,但不幸的是工具栏渲染存在问题(见下文)。显示图标路径而不是渲染。请给我相同的指示:)

羽毛笔组件:

import Quill from 'quill/core';
import Toolbar from 'quill/modules/toolbar';
import Snow from 'quill/themes/snow';
import Bold from 'quill/formats/bold';
import Italic from 'quill/formats/italic';
import React, { Component, Fragment } from 'react';
import Header from 'quill/formats/header';


Quill.register({
  'modules/toolbar': Toolbar,
  'themes/snow': Snow,
});


class MyQuill extends Component {

  constructor(props) {
    super(props);
  }


  componentDidMount(props) {
    var quill = new Quill('#editor', {
      theme: 'snow'
    });
  }

  render() {
    return (
      <div id="editor">
        <p>Hello World!</p>
        <p>Some initial <strong>bold</strong> text</p>
      </div>
    );
  }
}
export default MyQuill;

我终于能够修复它(见下文)。遗憾的是,如此出色的工具的文档却如此糟糕。

更改自:

import Quill from 'quill/core';

import Quill from 'quill/dist/quill.js';

来自:

Quill.register({
  'themes/snow': Snow,
});

Quill.register({
  'themes/snow.js': Snow,
});