问题:如何创建新的自定义管理器?
这期间,我尝试在 npm 上把我的自定义管理器添加到 grapesjs。 “''js 编辑/index.js ['Styles', 'StyleManager'], “设备管理器”, [“设备”,“设备管理器”], “PackageManager”,//此 ].forEach(prop => { 如果 (Array.isArray(prop)) { this[prop[0]] = em.get(prop[1]); 然而,我失败了。 这是我的测试代码: “''js 导出默认值 () =>{ 返回 { 名称:“PackageManager”, test(){ console.log(“你好表单包管理器”); } } } ``` 当我建...
阅读下方完整回答 ↓问题
你好,@artf,
我正在使用并开发葡萄树来做我的项目。我想添加一个新的管理器,让它叫“PackageManager”。不过,我找不到包含其他管理器的对象。
我如何将我的自定义管理器添加到葡萄?
回答(2)
这期间,我尝试在 npm 上把我的自定义管理器添加到 grapesjs。 “''js 编辑/index.js ['Styles', 'StyleManager'], “设备管理器”, [“设备”,“设备管理器”], “PackageManager”,//此 ].forEach(prop => { 如果 (Array.isArray(prop)) { this[prop[0]] = em.get(prop[1]); 然而,我失败了。 这是我的测试代码: “''js 导出默认值 () =>{ 返回 { 名称:“PackageManager”, test(){ console.log(“你好表单包...
谢谢你举报,@fzerman。 关于问题:如何创建新的自定义管理器? 非常好的问题。GrapesJS 推荐的方法是使用事件驱动 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console....
相关问答
通过相似的问题讨论继续研究。
问题 #3250
问题:图层标签
@artf我很喜欢和GJS合作。我还有最后一件事希望你能帮忙。 如果能在图层管理器中自定义标签会非常有帮助。我到处找过,但都没找到。 默认显示“文本”和“框”的方式,对于想要高效导航来说帮助不大。 <img width=“204” alt=“截图 2021-01-28 07 2...
问题 #3285
:画布iframe中的文档类型
嗨。 这个问题已经被问过两次([这里](https://github.com/artf/grapesjs/issues/973)和[这里](https://github.com/artf/grapesjs/issues/1230)),但从未有过答案。 有没有办法在画布ifram...
问题 #3367
模态模板
有没有办法修改已编译状态的模板? https://github.com/artf/grapesjs/blob/d3256e621bb43a537213ffcd86b10dc0bd070c0b/src/modal_dialog/view/ModalView.js#L1-L16 如...
问题 #3721
用Cypress测试拖拽
你好,@artf。我想用Cypress工具在GrapesJs上运行一些测试场景。但我无法用Cypress模拟拖拽模式。你能帮帮我吗? 谢谢。
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。