有没有办法在组件图中创建组件端口?
如果端口必须只连接到一个箭头,那很容易,因为我可以使用 #--
箭。
interface y
[x] #- y
问题是,如果我尝试将箭头连接到一个端口。我尝试使用
rectangle
,但那时它不在边界上。rectangle " " as P
[Component] - P
interface I1
interface I2
P - I1
P -- I2
你知道任何更好的解决方法吗?
最佳答案
虽然对 TO 来说有点晚了,但可能对其他人有帮助。
我设法使用以下方法在组件上创建端口:
@startuml
skinparam componentstyle uml2
left to right direction
component X {
port " " as x_out
}
'u for layouting it more nicely, 0) for lollipop
x_out -u0)- [Y]
x_out -u0)- [Z]
@enduml
但是我遇到了端口本身的糟糕布局,这意味着当一个组件有多个端口时,它会开始看起来很乱。但是,嘿,至少它是一个具有多个连接的端口。结果看起来像:
关于uml - PlantUML 组件图端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58468596/