reactjs - 无法在 reactjs 的 ckeditor5 中实现提及
问题描述
嗨,我正在使用 ckeditor 5,我想实现提及插件。
适合我通过npm安装@ckeditor/ckeditor5-react然后我安装ckeditor 5在线构建器(包括提及插件)然后我像这样导入文件
import { CKEditor } from '@ckeditor/ckeditor5-react';
import ClassicEditor from 'ckeditor5-custom-build';
import Mention from 'ckeditor5-custom-build'
这是我的组件
<CKEditor
editor={ClassicEditor}
config={{
plugins: [Mention],
mention: {
feeds: [
{
marker: '@',
feed: ['@Barney', '@Lily', '@Marshall', '@Robin', '@Ted'],
minimumCharacters: 1
}
]
}
}}
data={dataMess.smsMess}
onReady={editor => {
}}
onChange={(event, editor) => {
const data = editor.getData();
setDataMess({ ...dataMess, smsMess: data })
}}
onBlur={(event, editor) => {
// console.log('Blur.', editor);
getData(dataMess)
}}
onFocus={(event, editor) => {
// console.log('Focus.', editor);
}}
/>
但是当我按@时,没有出现下拉菜单,请给我提示,非常感谢!
解决方案
推荐阅读
- google-search - 如何在没有空格的情况下在 Google 上进行通配符搜索?前任。`google*` => 只匹配 `googled`,而不是 `google foo`
- python - 如何为 Anaconda 安装 MySQLdb?
- java - Gson 流关闭
- javascript - 通过 MQTT 发送字节数组 - JavaScript Paho Eclipse
- javascript - CheerioJS 从三个具有相同类名的 div 元素中选择一个
- javascript - 如何在Javascript中验证给定数字是否为整数?
- c# - 如何统一更改玩家位置?
- javascript - 使用 ElasticSearch 7.x 进行精确搜索
- gradle - 为 JAR 清单生成 Class-Path 属性
- apache-spark - 以独立模式在主节点上启动多个工作程序