样式管理器在选择组件时不会更新背景
你好@ronaldohoch问题出在你的自定义类型背景上,你添加它的方式不正确([正确使用API](https://grapesjs.com/docs/modules/Style-manager.html#adding-new-types))。 'addType' 主要用于添加新的 UI 输入,如果你不需要新的 UI(比如你这种情况),你可以依赖 ['addBuiltIn'](https://grapesjs.com/docs/api/style_manager.html#addbuiltin)来扩展默认背景属性('addBuiltIn' 的高级用法可以参考 [grapesjs-style-filter](https://gith...
阅读下方完整回答 ↓问题
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 勇敢浏览器 v1.39.111 可复制演示链接 https://jsfiddle.net/e7oau8v6/ 描述一下那个虫子 如何复现这个漏洞?画布上的一根柱子。 选择文本组件进入风格标签页,查找装饰背景设置背景图像。 更换组件。 背景属性不变  预期的行为...
回答(3)
你好@ronaldohoch问题出在你的自定义类型背景上,你添加它的方式不正确([正确使用API](https://grapesjs.com/docs/modules/Style-manager.html#adding-new-types))。 'addType' 主要用于添加新的 UI 输入,如果你不需要新的 UI(比如你这种情况),你可以依赖 ['addBuiltIn'](https://grapesjs.com/docs/api/style_manager.html#addbuiltin)来扩展默认背景属性('addBuiltIn' 的高级用法可以参考 [grapesjs-style-...
你好@artf,我遇到的问题和@ronaldohoch用最新版本的GrapesJS时很相似
背景图片预览显示错误链接
详情见下方图片:

谢谢你举报,@ronaldohoch。 关于样式管理器在选择组件时不会更新背景,这个问题很棒。推荐的 StyleManager 方法是使用事件驱动的 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c)...
相关问答
通过相似的问题讨论继续研究。
问题 #3564
无法刷新iframe
0.17.19 你能重现演示中的bug吗? 是的 预期的行为是什么? 我之前问过一个关于iframe刷新(#3413)的问题。[提案的解决方案](https://github.com/artf/grapesjs/issues/3413#issuecomment-83189223...
问题 #5990
当你删除组件时,组件间的重复类也会被删除。
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome 126.0.6478.127(Windows) 可复制演示链接 https://jsfiddle.net/t06s4oLb/8/ 描述一下那个虫子 如何复现这个漏洞?将第1节添加到画...
问题 #4138
风格管理器中的意外行为
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? 版本 1.35.101 Chromium:98.0.4758.87(官方版本)(64位) (64位) 可复制演示链接 https://codesandbox.io/s/strange-sun-qgdcq?fil...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。