ResetId类型不匹配
第一个是分量方法,第二个是块性质([此处使用](https://github.com/artf/grapesjs/blob/81295f637aa2542db9ba2aefb3ce34f0d6489d71/src/block_manager/index.ts#L166-L168))
阅读下方完整回答 ↓问题
葡萄JS版本
- 我确认使用最新版本的GrapesJS
你用的是什么浏览器?
无
可复制演示链接
无
描述一下那个虫子
如何复现这个漏洞?
- .去 https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/Component.js#L1839
- ..去 https://github.com/artf/grapesjs/blob/dev/index.d.ts#L1747
预期的行为是什么? ...resetId 应声明为方法。
目前的行为是什么? ...在 类型中,resetId 是一个可被 bool 消除的属性
行为准则
- 我同意遵守本项目的行为准则
回答(3)
我打开这个问题的原因是该方法不可见。 也许需要在类型中为方法声明创建一个新条目?比如setID /** * 在组件上设置新ID。 */ setId(id: string): this;
谢谢你举报,@vaneatka。 关于resetId类型不匹配的好问题。推荐的组件方法是使用事件驱动的API。 从这里开始: 查看你所在模块的[GrapesJS文档](https://grapesjs.com/docs/) 寻找“on()”事件监听器方法 大多数操作可以通过监听编辑器和组件事件来实现 常见模式: “JavaScript 留意变化 editor.on('change', () => console.log('something changed')); 组件生命周期 editor.on('component:mount', (c) => console.log('componen...
相关问答
通过相似的问题讨论继续研究。
问题 #3175
选择和激活RTE在程序化移除组件时未被清除
版本: 0.16.30 你能重现演示中的bug吗? [x] 是的 [ ] 不 繁殖步骤:在演示画布中选择文本组件选择框和RTE出现打开控制台执行 'editor.setComponents('');'组件被移除,但选择框和RTE仍然存在(见附图) 预期的行为是什么? 当程序性移...
问题 #4384
Index.d.ts说组件必须是Backbone.Collection,<Component>但文档上说Component[]也被接受
葡萄JS版本[X] 我确认使用最新版本的GrapesJS你用的是什么浏览器? 任何可复制演示链接 https://grapesjs.com/docs/modules/Components.html#component-definition描述一下那个虫子 如何复现这个漏洞?ht...
问题 #3459
DomComponents 的配置错误
版本: 0.17.3 预期的行为是什么? 文档说我可以通过以下配置配置来配置包装器元素: https://github.com/artf/grapesjs/blob/0027dcd1194715eeaf4b24db878dd7ebac069cc4/src/dom_compone...
问题 #5768
BlockProperties 中“content”属性的类型错误
葡萄JS版本 [X] 我确认使用最新版本的GrapesJS 你用的是什么浏览器? Chrome v122 可复制演示链接 不适用 描述一下那个虫子 GrapeJs 文档表明,可以在块的“content”属性中添加混合内容(见 https://grapesjs.com/docs/...
与此问题匹配的付费插件
根据问题关键词和标签相关性精选,助你更快交付。
正在加载付费插件推荐……
相关教程
关于同一主题的深入指南。
教程
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.
浏览插件分类
直接跳转到市场上的插件分类页面。