CKEditor5中addListToDropdown下拉菜单标签不显示问题求助
CKEditor5 42.0.0 自定义下拉菜单标签不显示问题
我使用CKEditor5 42.0.0版本(通过CDN引入),编写了自定义下拉菜单组件的代码,但调用addListToDropdown方法后,下拉菜单的标签无法正常显示。
相关代码如下:
editor.ui.componentFactory.add("InsertDropDown", locale => { //const dropdown = createDropdown(locale); const items = new Collection(); items.add({ type: 'button', model: new Model({ withText: true, label: 'First item', labelStyle: 'color: red' }) }); items.add({ type: 'button', model: new Model({ withText: true, label: 'Second item', labelStyle: 'color: green', class: 'foo' }) }); items.add({ type: 'button', model: new Model({ withText: true, label: 'Second item', labelStyle: 'color: green', class: 'foo' }) }); const dropdown = createDropdown(locale); dropdown.buttonView.set({ withText: true, label: "choose variable", tooltip: true }); addListToDropdown(dropdown, items); return dropdown; })
效果截图:
内容的提问来源于stack exchange,提问作者Shibon
相关产品推荐
相关产品推荐

