样式值变为“未定义!重要”
问题
嗨!
当我输入一个重要风格的房产时,这几乎没问题。当我清除字段的值(比如颜色类型)时,值被设置为“未定义!重要”。
要解决这个问题,在 Property.getFullValue 上,你必须先检查值,然后再添加“!important”:
如果(value !== 未定义 & & this.get('important')) { value = '${value} !important'; }
再见!
回答(1)
谢谢@WebEtSolutions下次版本会修复的
相关问答
通过相似的问题讨论继续研究。
问题 #4922
使用这里提供的!重要代码会破坏背景图像和渐变。
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Firefox 可复制演示链接 https://jsfiddle.net/jLgb0mv3/1/ 描述一下那个虫子 如何复现这个漏洞?...把这个代码放进编辑器: editor.on('style...
问题 #4079
新版本 v0.18.1 破坏了 styleable:change 上 !important 的脚本
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v96 可复制演示链接 没有演示 描述一下那个虫子 我用下面的代码把所有样式都设置为 !重要 '// 让所有风格都重要以覆盖元素类 editor.on('styleable:chan...
问题 #4233
从StyleManager插入样式,且带有重要 broken
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 铬 可复制演示链接 https://jsfiddle.net/q7cxvpf5/1/ 描述一下那个虫子 当我使用这段代码时,它在一次div更改后就停止工作,之后也不再接受对其他div进行样式更改:...
问题 #4010
[X] 我确认使用最新版本的GrapesJS
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome / Firefox 可复制演示链接 https://www.teamfunnels.net/login.php 演示演示 描述一下那个虫子 当我用这个代码让所有风格都变得重要时......
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
Vanilla GrapesJS vs GrapesJS With Plugins: What You Actually Get Out of the Box (2026)
New to GrapesJS? See exactly what the stock editor gives you, where it falls short, and which plugins close the gaps — a beginner-friendly 2026 comparison
教程
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 We Built Composeit in Record Time Using GrapesJS Shadcn
Bypass foundational builder boilerplate and focus on what truly matters.
浏览插件分类
直接跳转到市场上的插件分类页面。