安装

  • vscode安装PlantUML插件
  • 安装Graphviz

绘图

  1. 编写脚本:新建md文件

    1
    2
    3
    
    @startuml
    
    @enduml
    
  2. 查看图像:快捷键 Alt + DCtrl+Shift+P -> PlantUML -> Preview Current Diagram

  3. Ctrl + Shift + P -> Export Current Diagram导出

流程图

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@startuml

start
:步骤1处理;
:步骤2处理;
if (条件1判断) then (true)
    :条件1成立时执行的动作;
    if (分支条件2判断) then (no)
        :条件2不成立时执行的动作;
    else
        if (条件3判断) then (yes)
            :条件3成立时的动作;
        else (no)
            :条件3不成立时的动作;
        endif
    endif
    :顺序步骤3处理;
endif

if (条件4判断) then (yes)
:条件4成立的动作;
else
    if (条件5判断) then (yes)
        :条件5成立时的动作;
    else (no)
        :条件5不成立时的动作;
    endif
endif
stop

@enduml