SelectorManager 不返回字符串,而是一个对象
问题
**版本:0.16.30
你能重现演示中的bug吗?
[1] 是的
预期的行为是什么? SelectorManager.getState() 应根据 SelectorManager.getState() 返回字符串 https://grapesjs.com/docs/api/selector_manager.html#getstate
详细描述那个漏洞** 
目前的行为是什么? SelectorManager.getState() 返回的是对象而非字符串。
详细描述虫子**
你能附上截图、截屏或实时演示吗?
[1] 是的(附上)https://codesandbox.io/s/frosty-tdd-f5m3s?file=/index.js
回答(2)
你能帮我看看 https://github.com/artf/grapesjs/pull/3182 这解决了这个问题吗?谢谢
谢谢你举报,@congweibai。 SelectorManager 不返回字符串而是返回对象的问题似乎是竞态条件或状态管理时序问题。这通常发生在组件生命周期事件和DOM修改重叠时,导致状态不一致。 尝试什么: 添加setTimeout包装器以确保DOM已稳定: “JavaScript setTimeout(() => { 你在这里的行动 }, 0); 推荐的下一步步骤: 如果还没测试过,请用最新的GrapesJS版本测试 提供最小可重复的示例(CodeSandbox)——这有助于团队更快识别根本原因 在报告中包含 GrapesJS 版本、浏览器和控制台错误
相关问答
通过相似的问题讨论继续研究。
问题 #3125
线性渐变CSS对背景图像有奇怪的处理
版本:0.16.27 你能重现演示中的bug吗? [x] 是的 [ ] 不 预期的行为是什么? 通过样式管理器添加“background-image”时,显示为“background-image: url(...);`. 目前的行为是什么? 你会看到的不是“background...
问题 #5221
移动设备上的桌面版本
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? Safari 16.5可复制演示链接 https://grapesjs.com/demo.html https://staubgeborener.de/描述一下那个虫子 我试用的是官方的[演示](ht...
问题 #4575
AssetManagerConfig 中缺少自定义功能
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 铬 可复制演示链接 这是一个编译错误 描述一下那个虫子 AssetManagerConfig 中缺少属性自定义。 如果我用未分类的葡萄,它能行,但我想用它来搭配类型。有没有解决这个问题的解决办法?...
问题 #4356
选择器:移除事件不存在
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 铬101 可复制演示链接 https://jsfiddle.net/sdrf72wx/1/ 描述一下那个虫子 如何复现这个漏洞?在编辑器初始化时执行以下代码添加和移除组件的选择器查看控制台输出 预...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。