“enableEditing”附加在视图上,你可以从模型中获取它的实例,所以选择该组件,在控制台“editor.getSelected().view.enableEditing()”中执行。
问题
我正在获得 editor.getSelected().view.enableEditing();不是函数
回答(2)
请避免在未遵循问题模板的情况下打开错误问题。 你可以用一个合适的描述和用例来开启新的讨论。
错误editor.getSelected().view.enableEditing() is not a function之所以发生,是因为enableEditing方法并非直接在ComponentView实例上可用的公共API(editor.getSelected().view所指)。GrapesJS编辑器通过其专用的富文本编辑器(RTE)模块管理内联文本编辑,可通过editor.rte访问。 根本原因 GrapesJS Component模型(由editor.getSelected()获得)具有指向其ComponentView实例的view属性。虽然ComponentView负责渲染组件...
相关问答
通过相似的问题讨论继续研究。
问题 #3732
Comment component type do not support adding traits
我正在开发一个脚本,可以在所有组件类型上添加一个特征,但注释类型没有原型对象。 代码 “''js ddw = 编辑。DomComponents.getTypes(); 对于(设i = 0;i <ddw.length;i++) { DDQ = ddw[i].id; 编辑。DomC...
问题 #3309
TextNodes interfere when changing content on element
版本: 0.16.44 你好@artf 我有一个自定义方块,带有自定义按钮组件,内容和这个类似。 ` <a data-gjs-type=“custom_button” class=“btn btn-1” href=“”>Click here</a>' 此外,我添加了一个文本特性...
问题 #3124
Component:clicked / dbclicked event
你好,我正在尝试用视频组件在资产管理器中上传。我意识到我可以利用编辑器事件“component:selected”来实现这一点。 虽然能用,但并不完美。我更喜欢用双击触发资源管理器打开。 如果能有像“component:clicked/dbclicked”这样的事件,那就更好了
问题 #3578
版本0.17.4 尝试向主体添加背景图像时缺少组件
我补充道 domComponents: { storeWrapper: 1 }, 初始化网页编辑器时,启用将背景图像添加到正文中。 使用本地storageManager时工作正常,但使用远程storageManager时所有组件丢失 以下是数据 {“type”:“wrapper...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
Introducing Search on GJS.Market
GJS.Market now has one search across everything we publish — plugins, articles, community questions, guides, authors and services. Press ⌘K from any page.
教程
GJS.Market Is Now Available for India 🇮🇳
GJS.Market is expanding its global presence with a dedicated experience for developers, agencies, SaaS companies, and digital creators in India
教程
如何在2026年用 GrapesJS 构建AI驱动的页面构建器
我们构建GJSDocs的经验——从简单的AI文本生成到结构化、上下文感知的视觉编辑
浏览插件分类
直接跳转到市场上的插件分类页面。