应用 loadProjectData 后,轮廓会消失
@ronaldohoch用Edge浏览器,它用的是你提供的命令。 'let projectData = editor.getProjectData();' “编辑。DomComponents.clear();' 'editor.loadProjectData(projectData);' 我觉得GrapesJS不支持Brave浏览器,而Brave浏览器在 https://github.com/browserslist/caniuse-lite 里没有列出。 <img width=“1435” alt=“image” src=“https://user-images.githubusercontent.com/1437734/213...
阅读下方完整回答 ↓问题
葡萄JS版本
- 我确认使用最新版本的GrapesJS
你用的是什么浏览器?
勇敢的最后版本
可复制演示链接
描述一下那个虫子
如何复现这个漏洞?
- 打开演示页面
- 打开开发者工具
- 运行: 'let projectData = editor.getProjectData()'
- 跑:'编辑。DomComponents.clear()'
- 运行:editor.loadProjectData(projectData);
预期的行为是什么? 组件轮廓应被展示。
目前的行为是什么? 应用项目后,组件的轮廓没有显示。
行为准则
- 我同意遵守本项目的行为准则
回答(4)
@ronaldohoch用Edge浏览器,它用的是你提供的命令。 'let projectData = editor.getProjectData();' “编辑。DomComponents.clear();' 'editor.loadProjectData(projectData);' 我觉得GrapesJS不支持Brave浏览器,而Brave浏览器在 https://github.com/browserslist/caniuse-lite 里没有列出。 <img width=“1435” alt=“image” src=“https://user-images.githubusercon...
我还运行了命令 'editor.runCommand(“core:component-outline”)',但又没显示,我需要点击按钮两次才能显示
你好,@allenhwkim,谢谢你的评论。但尴尬的是我没在其他浏览器里测试。 我相信我的客户不使用Brave,所以我打算放弃这部分。 不过,通过所有这些测试,我成功地让它按我想要的方式工作,应用了以下代码: “''js editor.loadProjectData(JSON.parse(sessionStorage.getItem(commandOpts.value))); if(editor.Commands.isActive(“sw-visibility”){ 编辑。命令s.stop(“sw-visibility”); } editor.runCommand(“sw-visibilit...
谢谢你举报,@ronaldohoch。 关于应用loadProjectData后大纲消失的好问题。推荐的组件方法是使用事件驱动的API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console....
相关问答
通过相似的问题讨论继续研究。
问题 #4837
HTML元素的ID会在projectData加载的不同页面上递增
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Firefox 109 可复制演示链接 https://grapesjs.com/demo.html 描述一下那个虫子 你好, 我注意到当我在 projectData 中加载多个 HTML 中使用...
问题 #5346
删除组件而不删除其对应样式
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 最新版本的Chrome浏览器 可复制演示链接 https://grapesjs.com/demo.html 描述一下那个虫子 如何复现这个漏洞? <img width=“1665” alt=“im...
问题 #6606
编辑器加载时间很长(有时超过1分钟)
GrapesJS版本 [x] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Firefox 可复制演示链接 https://grapesjs.com/demo.html 描述一下那个虫子 描述 编辑器加载时间非常慢。 在复杂的页面(例如包含众多元素和插件如旋转木马...
问题 #5457
加载ProjectData 0.21.7时编辑器冻结
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome 117.0 可复制演示链接 本地主持 描述一下那个虫子 Grapesjs“: ”^0.21.7“, editor.loadProjectData({ “资产”: [], “风格”:...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。