补充 Mermaid 类图 语法.
Signed-off-by: chen.yang <chen.yang@yuzhen-iot.com>
This commit is contained in:
parent
59fd6800e4
commit
9c13aab590
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue