CKEditor 的块不可编辑[问题]
文本区不能被选中,因为它是组件“脚本”生成的静态元素,不属于编辑器,一切都是正确的。 如果你的目的是更改内部的 CKEditor 配置,你必须依赖组件特性,并在脚本中使用字符串插值(如 [docs](https://grapesjs.com/docs/modules/Components-js.html#basic-scripts)) 中描述的)。 “''js // ... 脚本:函数 () { const config1 = '{[ propertyName1 ]}'; const config2 = '{[ propertyName2 ]}'; const initCKeditor = 函数 () { // ... ```
阅读下方完整回答 ↓问题
大家好, 我添加了自定义的CKEdittor模块,运行正常。但真正的问题是我无法删除、移动或添加CKEditor模块中的特质。我尝试了所有可能的方法,但都没用。我真的坚持下去了。有人能帮帮我吗? 我的自定义方块: “''js 编辑。BlockManager.add('ckeditor', { 编号:“CKeditor”, 标签:“FA FA-check-Square”, 分类:“基础”, 内容: <textarea data-gjs-type=“ckeditor5” data-rte=“1” name=“content” id=“ckeditor”>这是一些示例内容。</textarea> , 可拖拽:确实, 可移除:真 }); 我的特质: const comps = 编辑器。主导组件; const defaultType = comps.getType('default'); const defaultModel = defaultType.model; comps.addType(buttonName, { model: defaultModel.extend({ defaults: Object.assign({}, defaultModel.prototype.defaults, { 可拖拽: '*', 可掉落:错误, 脚本:函数 () { const initCKedi...
回答(2)
文本区不能被选中,因为它是组件“脚本”生成的静态元素,不属于编辑器,一切都是正确的。 如果你的目的是更改内部的 CKEditor 配置,你必须依赖组件特性,并在脚本中使用字符串插值(如 [docs](https://grapesjs.com/docs/modules/Components-js.html#basic-scripts)) 中描述的)。 “''js // ... 脚本:函数 () { const config1 = '{[ propertyName1 ]}'; const config2 = '{[ propertyName2 ]}'; const initCKeditor =...
顺便说一句,不要这么做,'ClassicEditor.create(document.querySelector('#ckeditor')'' 这样,你的积分会同时出现多个分量。 我觉得你最好用这种方式更新你的资料 “''js 我用的是新的 API 来定义组件类型,你也应该这么做...... 默认值:{ 可拖拽: '*', 可掉落:错误, 默认组件内容 组件:“<textarea>这是一些示例内容。”</textarea> 脚本:函数 () { // ... const textareaEl = this.firstChild; ClassicEditor.create(textareaEl...
相关问答
通过相似的问题讨论继续研究。
问题 #648
面板可能是可移动的,但防止移动,移除子节点上的属性
你好, 我怎样才能防止搬迁,移除子孙的属性? 在这种情况下(见下方代码),用户可以移动父节点(Template2),但所有子节点不能移动。 我试过用“propagate”,但这些属性同样适用于父级。 我也需要一个专门针对儿童的房产选项。 'blockManager.add('T...
问题 #2433
在运行时更改事件中的分层功能不会立即更新
当我在事件中更改自定义组件的可分层选项时,它仍然会出现在图层中,直到你拖动一次。有没有办法通过强制图层更新来绕过这个问题?或者我们能不能给我们修复这个漏洞,谢谢。 视频: [葡萄layerable.zip](https://github.com/artf/grapesjs/fi...
问题 #665
自定义组件与存档
抱歉,又是我! 我正在尝试用我的新组件“img-link”保存我的模板: 但当我用“gjs-get-inlined-html”命令保存模板(这是一个新闻通讯模板)时,它不会保存我的图片的原始字符。 你能帮帮我吗? “JavaScript 导出默认值(编辑器,config = {...
问题 #1089
带有特质的自定义插件
“''js Grapesjs.Plugins.add('Social-Icons-Component', (editor, opts = {}) => { 设c = opts; 设默认值 = { 方块:“社交偶像”, 默认风格 defaultStyle: true, 默认的开始...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
GrapesJS Inline RTE Plugins Update: CKEditor 5 v0.1.4 and Froala Inline Text Editor
CKEditor 5 Inline for GrapesJS v0.1.4 fixes Studio SDK toolbar clipping, iframe injection and link balloon bugs. Compare with Froala Inline — both $69.
教程
GrapesJS vs Webflow vs Builder.io vs Puck: Which Visual Builder to Choose in 2026
A practitioner's 2026 comparison of GrapesJS, Webflow, Builder.io, and Puck — pricing, AI features, lock-in, and a one-line rule for picking the right one
教程
Big news from DevFuture — we just repriced everything
Hey GrapesJS community 👋 we just repriced all prices on plugins.
浏览插件分类
直接跳转到市场上的插件分类页面。