每次调用 editor.loadData(data, opts) 时,都会触发编辑器中定义的存储方法。Storage.add(“api-remote”, {...}),该文件记录“api-remote store”消息
问题
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 最新版本的Chrome浏览器 可复制演示链接 无效 描述一下那个虫子 如何复现这个漏洞? 很简单 预期的行为是什么? 我想用editor.load加载数据和切换页面,但我不想要编辑器。每次都要叫储藏。 目前的行为是什么? “每次调用 editor.loadData(data, opts) 时,它都会触发编辑器中定义的存储方法。Storage.add(“api-remote”, {...}),它记录了'api-remote store'消息。” 如果需要执行某些代码以重现该漏洞,请将其粘贴到下面: “''js export 函数 apiRemoteStoragePlugin(editor: any, opts: any = {}) { @ts-忽略 编辑。Storage.add(“api-remote”, { 异步负载() { const { pid, sid } = opts; 令rep = wait$http.get('/site-pages/${PID}'); 如果(代表?)siteId != sid) { throw new Error(“页面不存在”); } console.log(“resp=====”,pid,sid); return getProjectDataByQueryData(...
回答(2)
你可以动态更新“stepsBeforeSave”,以避免在存储调用时触发存储。 下次请使用讨论区,因为这不是个bug,而是实现问题。
谢谢你举报,@pittleCheung。 关于 editor.loadData(data, opts) 每次被调用时,都会触发编辑器中定义的存储方法,这个问题非常好。Storage.add(“api-remote”, {...}),它会记录消息“api-remote store”。GrapesJS 推荐的方法是使用事件驱动 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('ch...
相关问答
通过相似的问题讨论继续研究。
问题 #4792
20.2版本的拖放功能失效了
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? Chrome v108可复制演示链接 见下文描述一下那个虫子 如何复现这个漏洞?创建自定义组件将其作为组件和可拖拽块添加到编辑器中添加组件时将编辑器设置为绝对拖拽模式,丢弃后再将组件本身设为绝对拖拽。...
问题 #4851
This.on('change:attributes:type', this.handleTypeChange)不支持数组类型
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? Chrome 108.0.5359.125可复制演示链接 https://codesandbox.io/s/frosty-darkness-7po7xl描述一下那个虫子 如何复现这个漏洞?使用 myB...
问题 #6409
手机上无法拖动移动组件
葡萄JS版本 [x] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v133 可复制演示链接 https://jsfiddle.net/2hjdrb7L/1/ 描述一下那个虫子 如何复现这个漏洞? 用grapesjs v0.22.x和grapesjs...
问题 #4900
SetStyle/getCss() 生成重复的 CSS
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? Chrome 最新动态可复制演示链接 https://codesandbox.io/s/silent-river-ifczcv描述一下那个虫子 如何复现这个漏洞?访问网站参见控制台。注意“”和“bod...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。