FEAT:生成页面的 JSON 对象模型
我强烈建议阅读文档页面,如[组件](https://grapesjs.com/docs/modules/Components.html)和[存储管理器] ](https://grapesjs.com/docs/modules/Storage.html)涵盖了所有这些部分。
阅读下方完整回答 ↓问题
我需要生成设计页面的JSON对象模型,而不是生成HTML、CSS和JS代码,有没有函数可以返回设计页面的JSON对象? 另外,我是在Angular里实现UI构建器,所以优先使用TypeScript版本。
回答(2)
感谢你举报,@ola-893。 关于FEAT:生成页面的JSON对象模型,这是个很好的问题。推荐的 StyleManager 方法是使用事件驱动的 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) =...
相关问答
通过相似的问题讨论继续研究。
问题 #3612
葡萄的滑块按钮和标签键都没有按预期工作
版本 0.17.19(grapesjs) 版本 0.1.5(grapesjs-lory-slider) 版本 1.0.6(grapesjs-tabs) 你能重现演示中的bug吗? 不 预期的行为是什么? 我应该能在点击前一、下一页按钮和标签名时,浏览不同的幻灯片和标签页。 详细...
问题 #6152
通过自定义代码添加的CSS在移除自定义代码组件后依然存在
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 任何 可复制演示链接 https://grapesjs.com/demo 描述一下那个虫子 如何复现这个漏洞?添加带有HTML + CSS的自定义代码组件删除自定义代码组件。 预期的行为是什么?...
问题 #3627
:我正在尝试复制页面,但由于 ID,样式无法应用,结尾的 -2,-3 发生了变化。
“JavaScript const duplicatePage = (编辑者) => { let components = editor.getHtml(); 令 css = editor.getCss(); 让newPage = 编辑器。Pages.add({ 样式:CSS,...
问题 #4448
调整图片大小时出现错误。
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 勇敢浏览器 最后版本 可复制演示链接 https://grapesjs.com/demo.html 描述一下那个虫子 如何复现这个漏洞?打开演示页面。放置图像。双击选择图片。将宽度设置为100%。...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
Lighthouse for GrapesJS: Audit Accessibility and SEO Without Leaving the Editor
Live WCAG 2.1/2.2 accessibility auditor + SEO manager for GrapesJS. Every finding is bound to the exact component — click to select, then one-click fix.
教程
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.
教程
🚀 Introducing the New GrapesJS Plugin Generator on GJS.Market
We’re excited to announce a powerful new tool for GrapesJS developers — the GrapesJS Plugin Generator on GJS.Market!
浏览插件分类
直接跳转到市场上的插件分类页面。