能够访问/删除/拖动图层管理器中锁定的组件
你可以用“可分层:false”属性隐藏组件,或者创建自己的[自定义图层管理器界面](https://grapesjs.com/docs/modules/Layers.html#customization),包含所有需要的UI逻辑。
阅读下方完整回答 ↓问题
GrapesJS版本
- 我确认使用最新版本的GrapesJS
你用的是什么浏览器?
镀铬
可复制演示链接
https://codepen.io/Harshsne/pen/zxvREjB
描述一下那个虫子
如何复现这个漏洞?
- 拖拽文本组件
预期的行为是什么? 在图层管理器中不应该选择/拖拽它
目前的行为是什么? 在layermanager中选择/拖拽
甚至尝试过, 'const 图层 = 编辑器。层次; layers.setLocked(comp, true); console.log(layers.isLocked(comp));'
请提供一个解决办法,直到你尽快解决这个问题。@artf
行为准则
- 我同意遵守本项目的行为准则
回答(2)
你可以用“可分层:false”属性隐藏组件,或者创建自己的[自定义图层管理器界面](https://grapesjs.com/docs/modules/Layers.html#customization),包含所有需要的UI逻辑。
谢谢你举报,@yashvi2026。 关于能够访问/删除/拖动图层管理器中锁定组件的好问题。推荐的组件方法是使用事件驱动的API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console.log...
相关问答
通过相似的问题讨论继续研究。
问题 #6263
重复链接通过RTE添加
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? 铬可复制演示链接 https://codepen.io/Harshsne/pen/xxoOyXO描述一下那个虫子 如何复现这个漏洞?使用 RTE 添加词语链接,添加链接组件现在在链接组件后输入一个不留...
问题 #3731
文本元素在事件扩展后无法重复选择
版本:0.17.25 你能重现演示中的bug吗?[ ] 是的[x] 不 预期的行为是什么? 通过在视图中添加事件来更新现有的类型文本组件。 详细描述那个漏洞 事件正在添加,但一旦我选择了另一个组件,就无法回到第一个组件。该版本只能提交一次。 你能附上截图、截屏或实时演示吗?**...
问题 #3137
当我选择某个特定元素时,我没有看到它的样式。这个问题只发生在某些元素上。
未获得所选元素的样式 这是我的代码, const model = 编辑器。StyleManager.getModelToStyle(component); let styleObject = model.getStyle(); console.log(“样式”,styleObj...
问题 #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.
浏览插件分类
直接跳转到市场上的插件分类页面。