补充 Mermaid 类图 语法.

Signed-off-by: chen.yang <chen.yang@yuzhen-iot.com>
This commit is contained in:
chen.yang 2021-08-03 11:33:11 +08:00
parent 59fd6800e4
commit 9c13aab590
1 changed files with 65 additions and 0 deletions

View File

@ -132,6 +132,71 @@ Class01 : int gorilla
Class08 <--> C2: Cool label
```
### 4.1.语法
#### 4.1.1.泛化(Generalization)
继承、子类与父类
```mermaid
classDiagram
A<|--B
A:+int doing
A:+Can()
B:+flying()
```
#### 4.1.2.实现(Realization)
```mermaid
classDiagram
class IFlyable{
<<interface>>
+ flying()
}
IFlyable<|..Bat
Bat:+flying()
```
#### 4.1.3.组合(Composition)
```mermaid
classDiagram
Computer *-- CPU
Computer *-- Mainboard
Computer *-- HardDisk
Computer *-- MemeryCard
```
#### 4.1.4.聚合(Aggregation)
```mermaid
classDiagram
Company o-- Empolyee0
Company o-- Empolyee1
```
#### 4.1.5.关联(Association)
```mermaid
classDiagram
Reader "1..*" -- "1..*" Book
Book "1..*"--> "1"Author
```
#### 4.1.6.依赖(Dependency)
```mermaid
classDiagram
Animal..>Food
```
## 5.Mermaid 横向流程图
```mermaid