CSS 类名中 '/' 转换为 '-'
问题
葡萄JS版本
- 我确认使用最新版本的GrapesJS
你用的是什么浏览器?
Edge 版本 107.0.1418.52(官方构建)(64位)
可复制演示链接
https://codesandbox.io/s/peaceful-glade-rbfbwt?file=/src/app/app.component.ts
描述一下那个虫子
如何复现这个漏洞?
- 用葡萄酱创建新应用
- 调用 Grapejs 的初始化,使用默认配置。
- 新增名为“test1/2”的新职业
- 使用 developer toool 输入画布 html。
- 它被重新命名为“test1-2”。
预期的行为是什么? 类别名称不应更改。它应该保持原名。例如test1/2 在之前的版本中,我们能够在“selectorManagerConfig”中传递 escapeNames,而当前版本 0.20.1 中不支持这些功能
目前的行为是什么? 将类别名称中带有“/”的重命名为“-” 例如,“test1/2” 转为 “test1-2”
行为准则
- 我同意遵守本项目的行为准则
回答(2)
你仍然可以使用“escapeName”选项 “''js 选择经理:{ escapeName: value => value },
谢谢你举报,@hemaltandel1。 关于css类名中“/”转换为“-'的好问题。推荐的 Canvas 方法是使用事件驱动的 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console...
相关问答
通过相似的问题讨论继续研究。
问题 #3465
更新会破坏一些CSS功能
警告 请阅读并遵循接下来的三步,然后在发布问题前删除它们遵守贡献指南 https://github.com/artf/grapesjs/blob/master/CONTRIBUTING.md先快速搜索一下,看看有没有人没开同样的问题所有相关陈述/问题都必须填写/回答,否则问题可...
问题 #6685
自定义组件样式在删除和重新添加后不会被应用
GrapesJS版本 [x] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v143.0.7499.193 可复制演示链接 https://codesandbox.io/p/sandbox/2l3887 描述一下那个虫子 如何复现这个漏洞? 打开页面...
问题 #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.
浏览插件分类
直接跳转到市场上的插件分类页面。