gpt4 book ai didi

javascript - 在 JointJS 中,我收到错误属性 html 在类型 'typeof shapes' 上不存在

转载 作者:行者123 更新时间:2023-11-28 05:48:45 26 4
gpt4 key购买 nike

我想用 JointJS 开发一个应用程序。我正在遵循 JointJS 官方网站 ( http://www.jointjs.com/tutorial/html-elements ) 上找到的教程。到目前为止我只写了一行:

joint.shapes.html = {};

并且我已经收到错误:

“类型‘typeof Shapes’上不存在属性 html”

那是什么?

最佳答案

我想我已经找到答案了。因为实际上我没有使用 javascript,而是使用了 typescript。在 Typescript 中,您无法动态向对象添加属性,因此如果 Shapes 不包含名为 html 的属性,您就无法动态添加该属性。

关于javascript - 在 JointJS 中,我收到错误属性 html 在类型 'typeof shapes' 上不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38262274/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com