antvis/G6

Is the insert type abnormal? #6546

zzjjbbaa posted onGitHub

Describe the bug / 问题描述

image 怎么解决ts的类型报错(Rect是从antv/g中导出的shape

Steps to Reproduce the Bug or Issue / 重现步骤

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

macOS, Windows, Linux, Others / 其他

Browser / 浏览器

Chrome, Edge

Additional context / 补充说明

No response


你可以先使用 this.upsert(shapeId, 'rect', attributes, container) 来避免类型检查。 其中 Rect 已经注册到内部,可以使用 'rect' 别名

posted by Aarebecca 5 months ago

不过目前并没有发现类型异常,可以检查下依赖项版本

posted by Aarebecca 5 months ago

你可以先使用 this.upsert(shapeId, 'rect', attributes, container) 来避免类型检查。 其中 Rect 已经注册到内部,可以使用 'rect' 别名

有shape清单嘛,group有嘛?

posted by zzjjbbaa 5 months ago

不过目前并没有发现类型异常,可以检查下依赖项版本

antv/g的版本?

posted by zzjjbbaa 5 months ago

你可以先使用 this.upsert(shapeId, 'rect', attributes, container) 来避免类型检查。 其中 Rect 已经注册到内部,可以使用 'rect' 别名

有shape清单嘛,group有嘛?

常见的都有,详见:

https://github.com/antvis/G6/blob/6d01a5583135041cef73835ce046c33a88969396/packages/g6/src/registry/build-in.ts#L223-L237

posted by Aarebecca 5 months ago

Fund this Issue

$0.00
Funded

Pull requests