CKeditor 5 提及 React 不显示

问题描述 投票:0回答:1

我正在尝试在 React 应用程序中使用 CKEditor5 的 Mention 插件

这是我正在做的事情的一个例子,它是直接从他们网站上的教程中复制的 https://ckeditor.com/docs/ckeditor5/latest/api/module_mention_mentionconfig-MentionConfig.html 但无论我做什么,每次我在编辑器中键入@符号时,它都不会显示列表或任何内容。我在这里缺少一些可以让它工作的东西吗?

const editorConfiguration = {
  extraPlugins: ['Mention'],
  mention: {
      feeds: [
          {
              marker: '@',
              feed: [ '@Barney', '@Lily', '@Marry Ann', '@Marshall', '@Robin', '@Ted' ],
              minimumCharacters: 1
          }
      ]
  },
};
reactjs ckeditor
1个回答
0
投票

您忘记了插件参数,例如插件:[提及,/* ... */]。阅读更多内容文档

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        // This feature is available in the superbuild only.
        // See the "Installation" section.
        plugins: [ Mention, /* ... */ ],

        mention: {
            feeds: [
                {
                    marker: '@',
                    feed: [ '@Barney', '@Lily', '@Marry Ann', '@Marshall', '@Robin', '@Ted' ],
                    minimumCharacters: 1
                }
            ]
        }
    } )
    .then( /* ... */ )
    .catch( /* ... */ );

© www.soinside.com 2019 - 2024. All rights reserved.