如何识别哪个块被拖入画布?
你可以使用“block:drag:stop”事件 “''js editor.on('block:drag:stop', (component, block) => { // ... }) ```
阅读下方完整回答 ↓问题
我想补充一个小的“if”条件,比如: 如果(块1被拖拽){ 表演模态 }
回答(2)
你可以使用“block:drag:stop”事件 “''js editor.on('block:drag:stop', (component, block) => { // ... })
谢谢你举报,@echobinod。 关于如何识别哪个块被拖入画布?的好问题。GrapesJS 推荐的方法是使用事件驱动 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console.log(...
相关问答
通过相似的问题讨论继续研究。
问题 #3285
:画布iframe中的文档类型
嗨。 这个问题已经被问过两次([这里](https://github.com/artf/grapesjs/issues/973)和[这里](https://github.com/artf/grapesjs/issues/1230)),但从未有过答案。 有没有办法在画布ifram...
问题 #3715
如何添加点击事件
这是我自定义的区块代码: 我想在把按钮添加到画布后添加点击事件,点击后就能看到mj文本中的内容
问题 #3722
想添加固定大小的画布高度
我用它来制作动态PDF内容。 我想固定画布的高度,这样用户就不能从给定大小(高度)添加更多方块。 我想要删除滚动和一个消息或限制,比如不能添加更多物品之类的。 在同一个地方找到了一个旧问题 https://github.com/artf/grapesjs/issues/1803...
问题 #3385
如何用葡萄和nuxtj一起使用?
我正在尝试用 nuxtjs 框架来完成 grapesjs,有什么解决方案吗?
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。