我需要动态更改 svg 中 foreignObject 的高度。我必须使用foreignObject,因为我需要其中的html元素。(我正在使用 ngx-graph)。
<foreignObject x="1" y="1" width="335" [height]="foreignObjHeight(node.Data.length)" class="{{ checkIfSourceNode(node) }}"> ...
我收到错误:
TypeError:无法设置只有 getter 的 [object SVGForeignObjectElement] 的属性高度
请帮忙!