问题 #2308💬 已回答提出于 2019年10月5日作者 rajasubburaj0 个反应

创建图片链接后图片没有调整大小

快速解答作者 artf

你通过做这个“selectedComponent.view.el['outerHTML']来实现组件的扁平化,因此你移除了它的所有属性。 阅读更多关于[组件](https://grapesjs.com/docs/modules/Components.html)的工作原理。

阅读下方完整回答 ↓

问题

'''let selectedComponent = editor.getSelected(); 令 href = this.getHref(); 令title = this.title; let childHtml ='<a id=“${selectedComponent.ccid}” title=“${title}” href=“${href}” target=“_blank” class=“gjs-comp-selected”>${selectedComponent.view.el['outerHTML']}</a>'; const coll = selectedComponent.collection; const at = coll.indexOf(selectedComponent); coll.remove(selectedComponent); coll.add(childHtml, { at }); selectComponent.view.render();'''

回答(1)

相关问答

通过相似的问题讨论继续研究。

与此问题匹配的付费插件

根据问题关键词和标签相关性精选,助你更快交付。

查看全部插件

正在加载付费插件推荐……

免费方案

在以下平台查看开源 GrapesJS 插件: GitHub 或在我们的免费目录中快速搜索。

浏览免费插件 →
高级方案

高级插件提供支持、定期更新和生产就绪的功能——为你节省数天的集成工作。

浏览高级插件 →

浏览插件分类

直接跳转到市场上的插件分类页面。