本文是我畫時序圖常用的「模式」,更詳細的語法能夠 plantuml.com 查看bash
VSCodemarkdown
PlantUML 插件 工具
@startuml participant c as "Client" participant s as "Server" c -> s: fetch activate s c -> c: render activate c deactivate c s --> c: callback deactivate s c -> c: render activate c deactivate c @enduml 複製代碼
@startuml participant c as "Client" participant s as "Server" activate c c -> c: internal call 1 activate c deactivate c c -> c: internal call 2 activate c deactivate c @enduml 複製代碼
@startuml participant c as "Client" participant s as "Server" [-> c: enter [<- c: leave @enduml 複製代碼
@startuml participant c as "Client" participant s as "Server" alt a c -> s: a else b c -> s: b end @enduml 複製代碼
@startuml participant c as "Client" participant s as "Server" loop 1000 times c -> s: DNS Attack end @enduml 複製代碼
@startuml participant c as "Client" participant s as "Server" group title c -> s: do things end @enduml 複製代碼
@startuml participant c as "Client" participant s as "Server" c -> s: fetch note left: left note note over c, s multiline middle note end note s --> c: callback note right: right note @enduml 複製代碼
@startuml participant c as "Client" participant s as "Server" == Stage A == c -> s: A s --> c: callback == Stage B == c -> s: B s --> c: callback @enduml 複製代碼
@startuml participant s as "Server" box "Box" #LightBlue participant c as "Client" end box @enduml 複製代碼