如何:在 Canvas 上找到某个组件,在“component:add”事件中
感谢您的关注。 我刚看完那个纪录片。 最终得到了这个解决方案: editor.on('component:add', function(currentComp) { if (currentComp.attributes.tagName == “form”){ var modelList = (domComps.getComponents()).models; var presentForms = modelList.filter(function(component) { return component.attributes.tagName == “form”; }); 如果 (presentForms.length > 1){...
阅读下方完整回答 ↓问题
大家好, 假设我在<form>画布上添加了块状。当我下次添加(<form>第二次)时, 需要检查:如果这个组件已经存在于画布上, call function implodeComponents(presentedComp, recentlyAddedComp){}
但是,在事件编辑器.on('component:add'...我只能用最近添加的组件。 问题是:如何在画布上遍历所有组件,找到特殊组件(示例<form>) 请看看 http://prntscr.com/ij8c82 谢谢你的帮助。
回答(3)
感谢您的关注。 我刚看完那个纪录片。 最终得到了这个解决方案: editor.on('component:add', function(currentComp) { if (currentComp.attributes.tagName == “form”){ var modelList = (domComps.getComponents()).models; var presentForms = modelList.filter(function(component) { return component.attributes.tagName == “form”; }); 如果 (prese...
@konstantin55000 嗨,兄弟,domComps.getComponents() 正在获取所有模型,我只想拿到按钮。我该怎么做?谢谢
由于关闭后没有近期活动,该帖子已被自动锁定。请为相关漏洞开启新一期。
相关问答
通过相似的问题讨论继续研究。
问题 #687
在使用 editor.on('component:add',function(){} 更新组件属性后;蓝色盒子的商品不正确。
在使用 editor.on('component:add',function(){} 更新组件属性后; 蓝色方框的物品(指动作图标)不正确。复制图标不应该显示。  ![葡萄声](https://user-im...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
浏览插件分类
直接跳转到市场上的插件分类页面。