优点:是否可以为色彩选择器添加相对偏移量
你应该能通过这种方式定义颜色选择选项 “''js Grapesjs.init({ colorPicker: { ... } }); ``` 这里您可以查看所有[可用选项](https://github.com/artf/grapesjs/blob/86ce053309235c2a0a8bed9d9ded4326e82310df/src/utils/ColorPicker.js#L11)
阅读下方完整回答 ↓问题
 例如: 我在编辑器外面加了左边栏和上边栏。我知道颜色选择器的位置是相对于身体的,所以是否可以在配置中添加关联偏移?那我可以加一个-40来让选色器调到正确的位置吗?
回答(3)
你应该能通过这种方式定义颜色选择选项 “''js Grapesjs.init({ colorPicker: { ... } });
这里您可以查看所有[可用选项](https://github.com/artf/grapesjs/blob/86ce053309235c2a0a8bed9d9ded4326e82310df/src/utils/ColorPicker.js#L11)
在 .init() 之后,可以访问 colorPicker 吗?
我想动态更新托盘
谢谢你举报,@jcsofts。 关于FEAT:是否可以为颜色选择器添加相对偏移,这是个很棒的问题。GrapesJS 推荐的方法是使用事件驱动 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => c...
相关问答
通过相似的问题讨论继续研究。
问题 #3287
包装造型
首先,祝贺@artf完成了这个了不起的项目 💯 我目前正在做一个项目,想问一下是否可以像编辑里面其他组件那样编辑包装器(主体)。 例如,我想像编辑背景色一样编辑包装的填充部分。 并重新加载页面时遇到了一些问题,组件渲染不正确。显示的是空盒子。 举个例子:当我尝试从“jvas28/grapesjs-echarts”保存图表组件并重新加载页面时,会出现这种情况 <img width=“1438” alt=“截图 2021...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。