gpt4 book ai didi

javascript - Ckeditor5 - "widget toolbar no items"{toolbarId : 'mediaEmbed' }

转载 作者:行者123 更新时间:2023-12-05 01:27:10 25 4
gpt4 key购买 nike

我将 Ckeditor5 与 React 结合使用,当组件被渲染时,我在控制台中收到了这个警告,我该如何摆脱它?

Error screenshot

这是官方文档上的错误引用

https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-widget-toolbar-no-items

这是我的组件

export const EditorField = (props) => {

const {name,method,placeholder,isSimplified} = props

const link = {
decorators: {
toggleDownloadable: {
mode: 'manual',
label: 'Downloadable',
attributes: {
download: 'file'
}
},
openInNewTab: {
mode: 'manual',
label: 'Open in a new tab',
defaultValue: true,
attributes: {
target: '_blank',
rel: 'noopener noreferrer'
}
}
}
}
const image = {
toolbar: [
'imageTextAlternative',
'imageStyle:inline',
'imageStyle:block',
'imageStyle:side',
'linkImage'
]
}
const table = {
contentToolbar: [
'tableColumn',
'tableRow',
'mergeTableCells',
'tableCellProperties',
'tableProperties'
]
}
const toolbar = isSimplified ? {
items: [
'bold','italic','underline','strikethrough','|',
'link','|',
'specialCharacters','|',
'undo','redo'
], shouldNotGroupWhenFull: true
} : {
items: [
'heading','|',
'bold','italic','underline','strikethrough','|',
'fontColor','fontBackgroundColor','|',
'bulletedList','numberedList','|',
'link','imageUpload','insertTable','mediaEmbed','|',
'specialCharacters','blockQuote','horizontalLine','|',
'undo','redo'
], shouldNotGroupWhenFull: true
}

return (
<CKEditor
config={ {
toolbar,
language: 'it',
placeholder,
link,
image,
table,
} }
editor={ Editor }
data={request[name] || ''}
onChange={ (event, editor) => {
const data = editor.getData()
dispatch(setValue({method,name,value:data}))
} }
/>
)
}

最佳答案

我终于设法通过将其添加到我的配置中来解决此问题。

removePlugins: ["MediaEmbedToolbar"],

目前,这个插件没有做任何事情:https://github.com/ckeditor/ckeditor5/issues/9824

关于javascript - Ckeditor5 - "widget toolbar no items"{toolbarId : 'mediaEmbed' },我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69712116/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com