Javascript 如何在GoJS中向端口添加编号?
您好,我需要为每个端口添加编号,如下图所示。 注:我曾如何在本网站上寻找解决问题的方法,并使用Javascript 如何在GoJS中向端口添加编号?,javascript,gojs,Javascript,Gojs,您好,我需要为每个端口添加编号,如下图所示。 注:我曾如何在本网站上寻找解决问题的方法,并使用portId和TextBlock检查解决方案,但不起作用:/ 您正在使用一个形状作为端口,但任何GoJS对象都可以是端口,并且您确实希望使用一个带有形状和文本块的面板(自动面板)作为端口 我建议您阅读:您正在使用一个形状作为端口,但是任何GoJS对象都可以是端口,并且您确实希望使用一个带有形状和文本块的面板(自动面板)作为端口 我建议你读一读:嗨,谢谢你的回答:)嗯,我试着用一个面板,但我看不到变化:/
portId
和TextBlock
检查解决方案,但不起作用:/
您正在使用一个形状作为端口,但任何GoJS对象都可以是端口,并且您确实希望使用一个带有形状和文本块的面板(自动面板)作为端口
我建议您阅读:您正在使用一个形状作为端口,但是任何GoJS对象都可以是端口,并且您确实希望使用一个带有形状和文本块的面板(自动面板)作为端口
我建议你读一读:嗨,谢谢你的回答:)嗯,我试着用一个面板,但我看不到变化:/我做错了什么
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'))
)
}
),
嗨,谢谢你的回答:)嗯,我试着用一个面板,但我看不到变化:/我做错了什么
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'))
)
}
),