Editor.gethtml() 上缺少类
问题
我能看到 Canvas 上添加了类,但当我通过 editor.gethtml() 获取 HTML 时,有些类没有包含,只有没有任何类的 div。附上截图,Canvas上有HTML和通过editor.gethtml()提供的HTML
回答(3)
别以为“gjs-”前缀的职业会回归
当你使用 'editor.getHtml' 时,它只返回 html 。 如果你也需要 CSS,可以用 'editor.getCss()'。
我用的是newsletter-plugin和'const html = window.grapesjs.editors[0].runCommand('gjs-get-inlined-html')'
相关问答
通过相似的问题讨论继续研究。
问题 #528
模型与组件示例代码及问题
@artf 抱歉又制造了问题,但我尝试了下面的代码,我也为它创建了 codepen。 [“代码笔”](https://codepen.io/anon/pen/qVXejm) 但它仍然只通过 editor.getHtml(), 返回空 div ,在 Canvas 上是合适的,但在最终的 html(editor.getHtml())中不行,我看过“https://grapesjs.com/docs/modules/Components.html#defin...
问题 #529
Editor.setComponents(html) 在编辑器中重置为默认的特征值
#522 感谢大家的帮助,我通过 this.model.attributes 解决了问题。但现在我又遇到了另一个问题,editor.setComponents 在 html 编辑器中重置了 value,且 html 还原为默认特征值。 应用流程 1)用户被重定向到 grapes...
问题 #1539
如何以及在哪里定义形态的行为
大家好, 我如何从Grapesjs的表单中获取数据? 我已经在Canvas上放置了一份表格,你可以在下面看到 ![4444444](https://user-images.githubusercontent.com/32187513/47430117-115b0e80-d7b6...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
浏览插件分类
直接跳转到市场上的插件分类页面。