【发布时间】:2019-03-15 20:37:10
【问题描述】:
您好,我需要为每个端口添加编号,如下图所示。
附言。我如何在此站点上寻找解决问题 https://gojs.net/latest/intro/ports.html 并使用 portId 和 TextBlock 检查解决方案,但它不起作用:/
【问题讨论】:
标签: javascript gojs
您好,我需要为每个端口添加编号,如下图所示。
附言。我如何在此站点上寻找解决问题 https://gojs.net/latest/intro/ports.html 并使用 portId 和 TextBlock 检查解决方案,但它不起作用:/
【问题讨论】:
标签: javascript gojs
您正在使用 Shape 作为端口,但任何 GoJS 对象都可以是端口,并且您确实想使用具有 Shape 和 TextBlock 作为端口的面板(自动面板)。
【讨论】:
您好,谢谢您的回答 :) 嗯,我尝试使用面板,但没有看到变化:/ 我做错了什么?
this.$(go.Panel, 'Horizontal',
new go.Binding('itemArray', 'bottomArray'),
{
row: 2, column: 1,
itemTemplate:
this.$(go.Panel, 'Vertical',
{
_side: 'bottom',
fromSpot: go.Spot.Bottom, toSpot: go.Spot.Bottom, fromMaxLinks: 1,
fromLinkable: true, toLinkable: false, cursor: 'pointer'
},
new go.Binding('portId', 'portId'),
this.$(go.Shape, 'RoundedRectangle',
{
stroke: null, strokeWidth: 0,
desiredSize: portSize,
margin: new go.Margin(2, 1, 0, 1)
},
new go.Binding('fill', 'portColor')),
this.$(go.TextBlock,
new go.Binding('text', 'name'))
)
}
),
【讨论】: