1. VSCode安装插件
安装 PlantUML 和 PlantUML-Simple Viewer 两个插件
2. 新建一个.puml后缀的文件
3. PlantUML画用例视图
编写代码:
@startuml
left to right direction
actor "Food Critic" as fc
rectangle Restaurant {
usecase "Eat Food" as UC1
usecase "Pay for Food" as UC2
usecase "Drink" as UC3
}
fc --> UC1
fc --> UC2
fc --> UC3
@enduml
预览效果:
文件编辑区域点击鼠标右键,选择预览
出现效果如下: