重复CSS
谢谢你举报,@sammrafi。 关于重复CSS的好问题。推荐的 StyleManager 方法是使用事件驱动的 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console.log('component ready', c));...
阅读下方完整回答 ↓问题
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 116.0.5845.187(官方构建)(64位) 可复制演示链接 https://jsfiddle.net/bw4Lxp6c/ 描述一下那个虫子 如何复现这个漏洞? 当我添加一列时,它会生成重复的 CSS 格式(最大宽度:768px) @media 预期的行为是什么? CSS 代码应该生成一次。 目前的行为是什么? @media中复制CSS代码(最大宽度:768px) 如果需要执行某些代码以重现该漏洞,请将其粘贴到下面: “''js <div temporary=“”> <div> </div> </div> <div class=“row”> <div class=“cell”> <section class=“bdg-sect”> <h1 class=“heading”>在此插入标题 </h1> <p class=“paragraph”>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua </p> </section> </div> <div class=“cell”> <img src=“/media...
回答(1)
谢谢你举报,@sammrafi。 关于重复CSS的好问题。推荐的 StyleManager 方法是使用事件驱动的 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console.log('co...
相关问答
通过相似的问题讨论继续研究。
问题 #5424
'component:styleUpdate' 事件未被触发
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? Chrome 116.0.5845.187可复制演示链接 https://jsfiddle.net/yLcvbwjd/描述一下那个虫子 如何复现这个漏洞?添加“component:styleUpdat...
问题 #4310
样式管理器在使用包含“bout”和 componentFirst = true 的组合 CSS 选择器时不准确
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome 100 可复制演示链接 https://jsfiddle.net/4fmd732c/3/ 描述一下那个虫子 如何复现这个漏洞? 给定 a) “componentFirst”设置为“t...
问题 #6685
自定义组件样式在删除和重新添加后不会被应用
GrapesJS版本 [x] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v143.0.7499.193 可复制演示链接 https://codesandbox.io/p/sandbox/2l3887 描述一下那个虫子 如何复现这个漏洞? 打开页面...
问题 #6502
内联样式覆盖基于ID的CSS规则
GrapesJS版本 [x] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v135.0.7049.96 可复制演示链接 https://jsfiddle.net/bqkLwt8j/ 描述一下那个虫子 当元素具有内联样式且匹配基于ID的CSS规则时,...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。