YAML数组

一组连词线开头的行,构成一个数组
- Cat
- Dog
- Goldfish

转为JavaScript

[ 'Cat', 'Dog', 'Goldfish' ]
数据的子结构也是一个数组,可以在该项下面缩进空格来表示层级关系
-
  - Cat
  - Dog
  - Goldfish
转为JavaScript

[ [ 'Cat', 'Dog', 'Goldfish'] ]
数组也可以采用行内表示法

animal: [Cat, Dog]
转为JavaScript

{ animal: ['Cat', 'Dog']}

Copyright © 2015-2026