克隆页面提示“将循环结构转换为 JSON”
问题
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? Chrome 129.0.6668.101可复制演示链接 https://grapesjs.com/demo描述一下那个虫子 如何复现这个漏洞? 开放 https://grapesjs.com/demo 在 DevTools 中运行这个脚本: “''js const page = 编辑。Pages.getSelected(); const component = page?.getMainComponent()?clone(); 编辑。Pages.add({ 名称:“11111”, 组成部分, }, { 选择:真, }); TypeError:将循环结构转换为 JSON --> 从对象开始,构造子为 'o' | 属性 'opts' -> 对象,构造子为 'Object' | property 'el' -> 对象,构造子为 'HTMLHeadElement' ---性质“__gjsv”闭合了圆 at JSON.stringify (<anonymous>) at o.storeData ([email protected]:2:1015087) 在O.<anonymous>([email protected]:2:1014457) 在[email protected]:2:999571 在Object.next(g...
回答(2)
除了上述方法,还有其他复制页面的方法吗?
谢谢你举报,@maxming2333。 关于Clone页面提示“将循环结构转换为JSON”,这个问题非常好。推荐的组件方法是使用事件驱动的API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => con...
相关问答
通过相似的问题讨论继续研究。
问题 #5175
移动方法没有按预期工作
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 铬 可复制演示链接 https://codesandbox.io/s/adoring-margulis-873kdv 描述一下那个虫子 背景 移动组件的方法没有按预期工作。 这段代码没有按预期工作...
问题 #5768
BlockProperties 中“content”属性的类型错误
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v122 可复制演示链接 不适用 描述一下那个虫子 GrapeJs 文档表明,可以在块的“content”属性中添加混合内容(见 https://grapesjs.com/docs/...
问题 #5503
ReplaceWith 方法没有字符串类型
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 铬 可复制演示链接 没有 描述一下那个虫子 Component.ts 的 replaceWith 方法没有字符串类型。 预期的行为是什么? 我应该可以用字符串替换组件,比如示例中的“compone...
问题 #3316
编辑器不会移除死稿块
版本: 0.16.34 你能重现演示中的bug吗? [ ] 是的 [x ] 不 据我了解,导入代码对话框跳过了所有HTML脚本,所以我无法在演示中重现这个问题 预期的行为是什么? 编辑者必须先移除失效脚本块,才能在生成的HTML末尾添加新的脚本块 详细描述那个漏洞* 我在项目中...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
Vanilla GrapesJS vs GrapesJS With Plugins: What You Actually Get Out of the Box (2026)
New to GrapesJS? See exactly what the stock editor gives you, where it falls short, and which plugins close the gaps — a beginner-friendly 2026 comparison
教程
GrapesJS DevTools: A Developer Panel Inside Your Editor
If you've ever debugged GrapesJS with console.log(editor.getSelected()) and a dozen throwaway event listeners — this post is for you.
教程
How We Built Composeit in Record Time Using GrapesJS Shadcn
Bypass foundational builder boilerplate and focus on what truly matters.
浏览插件分类
直接跳转到市场上的插件分类页面。