自定义方块图标
嗨,@mingxin-yang,你可以阅读[这里](https://grapesjs.com/docs/modules/Blocks.html)如何创建和更新方块。 如果你需要更新方块的图标或标签,可以这样做: “''js 编辑。Blocks.get('BLOCK-ID').set({ 标签:“我的街区”, 媒体:“<SVG...”,// 例如:你的SVG图片 }) ```
阅读下方完整回答 ↓问题
我想自定义封锁图标,我找到了代码:
.gjs-f-text::before {
内容:“O”;
}
.gjs-fonts::before {
显示:方块;
字体:普通普通 14px Font3336;
文本渲染:自动;
-webkit-font-smoothing:抗锯齿;
-moz-osx-font-smoothing:灰度;
字体大小:5em;
}
如何找到我想要的“内容”? 
回答(2)
嗨,@mingxin-yang,你可以阅读[这里](https://grapesjs.com/docs/modules/Blocks.html)如何创建和更新方块。 如果你需要更新方块的图标或标签,可以这样做: “''js 编辑。Blocks.get('BLOCK-ID').set({ 标签:“我的街区”, 媒体:“<SVG...”,// 例如:你的SVG图片 })
谢谢你举报,@mingxin阳。 关于自定义方块图标的好问题。GrapesJS 推荐的方法是使用事件驱动 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console.log('compon...
相关问答
通过相似的问题讨论继续研究。
问题 #3315
毫米或厘米单位转换为px。
我意识到毫米或厘米单位是可以转换成像素的。我该如何解决这个问题? 谢谢你 ,这是错了还是我做错了?我本以为资源不会显示出来,但它们全都可见 ) 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.
浏览插件分类
直接跳转到市场上的插件分类页面。