Bug
问题
GrapesJS 版本
- 我确认使用最新版本 GrapesJS
你用的是什么浏览器?
v9.2
可复制演示链接
描述一下那个虫子
我在 Vue3 项目中使用它 当我想添加新组件时,页面会挂机且没有响应 这是我的代码:
const selectedComponent = this.editoren.getSelected();
if (selectedComponent) {
const newComponent = this.editoren.DomComponents.getWrapper().append({
type: 'text',
content: 'New text component',
});
selectedComponent.components().add(newComponent);
this.editoren.refresh();
}
行为准则
- 我同意遵守本项目的行为准则
回答(3)
你好!😊
我不认为这是GrapesJS的bug。我查看了你的复制链接,尝试在画布中添加组件,完全没问题。👍
你遇到的问题是,当程序性添加新组件时页面卡顿,源于组件创建和附加方式不当, GrapesJS。你本质上是在添加一个已经作为另一个组件子节点附加到编辑器根包装器的组件,导致无效状态并导致编辑器卡死。 根本原因 让我们拆解一下你的原始代码: this.editoren.DomComponents.getWrapper().append(...):该行根据提供的定义({ type: 'text', content: 'New text component' })创建一个新组件,并立即将其附加到编辑器的根包装器中。此时, newComponent 是一个 GrapesJS 组件模型实例,已经是编辑器...
相关问答
通过相似的问题讨论继续研究。
问题 #5131
JSON.stringify 之后,组件并非所有字段都存在
GrapesJS 版本[X] 我确认使用最新版本 GrapesJS你用的是什么浏览器? 铬可复制演示链接 https://jsfiddle.net/sdimitrenco/rn8u4pc0/7/描述一下那个虫子 我不确定这是不是bug,但对我来说,这种行为看起来很奇怪 我有一个...
问题 #4601
在切换某些目标时,添加到样式管理器的自定义类型 update() 不再被触发。
GrapesJS 版本 [X] 我确认使用最新版本 GrapesJS 你用的是什么浏览器? 铬104 可复制演示链接 https://jsfiddle.net/aw8p0h9j/ 描述一下那个虫子 如何复现这个漏洞?打开 jsfiddle 链接。点击两个div之间,然后在任一d...
问题 #3779
Editor.getSelected().toHTML() encodes inline javascript
GrapesJS 版本[X] 我确认使用最新版本 GrapesJS你用的是什么浏览器? 最新款(镀铬)可复制演示链接 https://jsfiddle.net/4j1k0wde/24/描述一下那个虫子 如何复现这个漏洞?创建带有脚本标签的方块。使用 editor.getSele...
问题 #6409
Cannot drag to move components on mobile
GrapesJS版本 [x] 我确认使用最新版本GrapesJS 你用的是什么浏览器? Chrome v133 可复制演示链接 https://jsfiddle.net/2hjdrb7L/1/ 描述一下那个虫子 如何复现这个漏洞? 使用grapesjs v0.22.x 初始化一...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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文本生成到结构化、上下文感知的视觉编辑
浏览插件分类
直接跳转到市场上的插件分类页面。