在打开图层管理器中点击眼睛图标时隐藏元素
给你 https://github.com/artf/grapesjs/blob/d802eba08559a3e1c7830e937a78b0b2a417f2e4/src/navigator/view/ItemView.js#L12-L22
阅读下方完整回答 ↓问题
我想看到代码处理事件隐藏或删除元素。我在哪里能找到它? <img width=“958” alt=“Capture” src=“https://user-images.githubusercontent.com/56115755/99949266-509d2480-2dad-11eb-8203-51432975b4d3.PNG”>
非常感谢!
回答(2)
谢谢你举报,@phamhongphuc1999。 关于在打开图层管理器中点击眼睛图标时隐藏元素的问题非常好。GrapesJS 推荐的方法是使用事件驱动 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c)...
相关问答
通过相似的问题讨论继续研究。
问题 #3315
毫米或厘米单位转换为px。
我意识到毫米或厘米单位是可以转换成像素的。我该如何解决这个问题? 谢谢你 (arm64) 可复制演示链接 截图:https://d.pr/i/AyHJyL 描述一下那个虫子 如何复现这个漏洞?升级到最新的葡萄品种。 预期的行...
问题 #3309
TextNodes 在元素内容更改时会干扰
版本: 0.16.44 你好@artf 我有一个自定义方块,带有自定义按钮组件,内容和这个类似。 ` <a data-gjs-type=“custom_button” class=“btn btn-1” href=“”>Click here</a>' 此外,我添加了一个文本特性...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。