新存储不起作用
你必须使用插件 'plugins: [dbStoragePlugin, 'gjs-blocks-basic']'使用“autosave: false”时,你是在禁用自动保存,这意味着只有在程序调用(例如“editor.store()”)时,“Storage.store”才会被触发。没有“setStepsBeforeSave”选项,只有“stepsBeforeSave”
阅读下方完整回答 ↓问题
葡萄JS版本
- 我确认使用最新版本的GrapesJS
你用的是什么浏览器?
铬
可复制演示链接
https://jsfiddle.net/1vknjLst/
描述一下那个虫子
如何复现这个漏洞? 点击运行
预期的行为是什么? 应该会在新存储中读取并保存,控制台应该显示“正在加载中”
目前的行为是什么? 什么都没发生
如果需要执行某些代码以重现该漏洞,请将其粘贴到下面: “''js 你的代码在这里
### 行为准则
- [X] 我同意遵守本项目的行为准则
回答(3)
- 你必须使用插件 'plugins: [dbStoragePlugin, 'gjs-blocks-basic']'
- 使用“autosave: false”时,你是在禁用自动保存,这意味着只有在程序调用(例如“editor.store()”)时,“Storage.store”才会被触发。
- 没有“setStepsBeforeSave”选项,只有“stepsBeforeSave”
谢谢你!这样很好用
谢谢你举报,@wyxcoder。 关于新存储不工作的好问题。GrapesJS 推荐的方法是使用事件驱动 API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console.log('compone...
相关问答
通过相似的问题讨论继续研究。
问题 #6116
AsDocument 无法如预期工作
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 铬128 可复制演示链接 https://jsfiddle.net/sammousa/bxgsdc12/11/ 描述一下那个虫子 如何复现这个漏洞?加载一个带有非空 '' 的 HTML 字符串<h...
问题 #5689
<> 在开头引入 editor.getHtml()
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? Chrome 版本 121.0.6167.185(官方构建)(64 位)可复制演示链接 https://jsfiddle.net/ja50kzne/4/描述一下那个虫子 如何复现这个漏洞?我之前有个...
问题 #5442
应用文本颜色后,无法设置背景颜色
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? 镀铬 可复制演示链接 https://jsfiddle.net/a3xgLm7c/3/ 描述一下那个虫子 如何复现这个漏洞?选择文本并应用文本颜色选择相同的文本并应用背景色 预期的行为是什么?两种...
问题 #4506
拖拽模式下的拖拽块错误:绝对
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v103 可复制演示链接 https://stackblitz.com/edit/js-1xpo7b 描述一下那个虫子 如何复现这个漏洞?使用dragMode:绝对(设计师模式)从块...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。