更改根节点后,无法在 layerManager 中拖放元素
谢谢你举报,@mohammedmoulla。 关于更改root后无法在layerManager中拖放元素的好问题。推荐的 Canvas 方法是使用事件驱动的 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console.log('...
阅读下方完整回答 ↓问题
GrapesJS版本
- 我确认使用最新版本的GrapesJS
你用的是什么浏览器?
Google Chrome v139.0.7258.128
可复制演示链接
https://codesandbox.io/p/sandbox/relaxed-payne-vt3pgc
描述一下那个虫子
如何复现这个漏洞?
- 在画布上添加一些元素
- 尝试在图层管理器中查找元素并拖动或移动它们
预期的行为是什么? 在0.20.2版本中运行得很完美
目前的行为是什么? 不能更改图层管理器树的根节点 ==> 只能更改主体 我尝试了所有方法,但都没用
如果需要执行某些代码以重现该漏洞,请将其粘贴到下面: 不,直接打开链接
行为准则
- 我同意遵守本项目的行为准则
回答(1)
谢谢你举报,@mohammedmoulla。 关于更改root后无法在layerManager中拖放元素的好问题。推荐的 Canvas 方法是使用事件驱动的 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount',...
相关问答
通过相似的问题讨论继续研究。
问题 #4489
从设计模式项目加载初始项目数据会导致画布大小错误
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v103 可复制演示链接 https://codesandbox.io/s/laughing-austin-k12mc3?file=/index.js 描述一下那个虫子 如果你查看链...
问题 #3806
添加视频时目标为零
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome新版本 可复制演示链接 https://codesandbox.io/s/react-redux-toolkit-application-forked-l5rhp?file=/src/...
问题 #6663
符号在逐步加载页面时会断裂(实例丢失__symbol链接)
这里有一段展示这个bug的视频: https://github.com/user-attachments/assets/0fdc76ed-cee5-4481-98b1-cbbf52572b31 GrapesJS版本 [x] 我确认使用最新版本的GrapesJS 你用的是什么浏览...
问题 #6409
手机上无法拖动移动组件
葡萄JS版本 [x] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v133 可复制演示链接 https://jsfiddle.net/2hjdrb7L/1/ 描述一下那个虫子 如何复现这个漏洞? 用grapesjs v0.22.x和grapesjs...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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 to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
教程
Big Updates: TinyMCE 8 and Placeholder 2.0 for GrapesJS
In May we shipped major updates to two of our most popular GrapesJS plugins — TinyMCE Inline Text Editor and Placeholder.
浏览插件分类
直接跳转到市场上的插件分类页面。