刷新页面 我们将失去主体/包装的背景颜色
问题
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome 98.0.4758.109 可复制演示链接 https://jsfiddle.net/szLp8h4n 描述一下那个虫子 如何复现这个漏洞?“正体(选定 #wrapper)->装饰 ->背景色和颜色保存更改后刷新页面 预期的行为是什么? 刷新页面后显示背景色,并保持背景色设置 目前的行为是什么? 身体没有背景,背景颜色设置为零 我检查了保存数据,发现我们保存了包装器ID及其样式,而刷新页面包装器后每次都会获得新的ID。 <img width=“936” alt=“image” src=“https://user-images.githubusercontent.com/65819265/156588594-a55fb652-5044-44de-9468-5960e9e38d9f.png”> <img width=“886” alt=“image” src=“https://user-images.githubusercontent.com/65819265/156588892-386065be-1b61-4c48-a0c2-91c61a7cbd20.png”> 而其他区块的ID在刷新页面后不会改变。 我们如何给包装器应用背景色,同时保持背景颜色设置? 我在初始化中也设置了这些设置: s...
回答(2)
你好@javadsamiee谢谢你的报告。这实际上是一个旧问题#2834,我正试图在下一个版本中解决它(我关闭本期,转而关注旧问题)。
谢谢你举报,@javadsamiee。 关于刷新页面我们将失去身体/包装背景颜色的好问题。推荐的 StyleManager 方法是使用事件驱动的 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) =>...
相关问答
通过相似的问题讨论继续研究。
问题 #3397
分拣器方向与网页组件槽不符
版本:0.16.45 你能重现演示中的这个bug吗?[x] 是的[ ] 不 预期的行为是什么? 给定一个父网页组件实例渲染一些元素,在 shadowDOM 中,如果 'slot' 的父元素具有 'display: flex' 风格,排序器应是垂直的,因为结果中元素是水平对齐的。...
问题 #3396
Flex-direction: column & float: left,使排序器方向错误
版本:0.16.45 你能重现演示中的这个bug吗?[x] 是的[ ] 不 预期的行为是什么? 给定一个父元素,其样式为“display: flex”和“flex-direction: column”,子元素的样式为“float: left”,排序器应为水平排列,因为结果中元素...
问题 #5263
如果删除组件但不删除其对应样式,之后添加新组件会导致样式冲突吗?
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 最新版本的Chrome浏览器 可复制演示链接 无效 描述一下那个虫子 如何复现这个漏洞? <img width=“1666” alt=“image” src=“https://github.com...
问题 #5346
删除组件而不删除其对应样式
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 最新版本的Chrome浏览器 可复制演示链接 https://grapesjs.com/demo.html 描述一下那个虫子 如何复现这个漏洞? <img width=“1665” alt=“im...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。