Stack
Stack 组件管理沿垂直或水平轴的子组件的布局,每个子组件之间有可选的间距和/或分隔线。
Item 1
Item 2
Item 3
<Stack spacing={2}>
  <Item>Item 1</Item>
  <Item>Item 2</Item>
  <Item>Item 3</Item>
</Stack>要控制子组件之间的空间,请使用 spacing 属性。 The spacing value can be any number, including decimals and any string. The prop is converted into a CSS property using the theme.spacing() helper.
方向
Stack is concerned with one-dimensional layouts, while Grid that handles two-dimensional layouts. The default direction is column which stacks children vertically. 然而, direction prop 也可以用来将项目水平定位在 row 中。
Item 1
Item 2
Item 3
<Stack direction="row" spacing={2}>
  <Item>Item 1</Item>
  <Item>Item 2</Item>
  <Item>Item 3</Item>
</Stack>Dividers(分隔线)
使用 divider prop 在每个子节之间插入一个元素。 在 Divider 组件中运行得尤其好。
Item 1
Item 2
Item 3
<Stack
  direction="row"
  divider={<Divider orientation="vertical" flexItem />}
  spacing={2}
>
  <Item>Item 1</Item>
  <Item>Item 2</Item>
  <Item>Item 3</Item>
</Stack>Item 1
Item 2
Item 3
<Stack
  direction={{ xs: 'column', sm: 'row' }}
  spacing={{ xs: 1, sm: 2, md: 4 }}
>
  <Item>Item 1</Item>
  <Item>Item 2</Item>
  <Item>Item 3</Item>
</Stack>Item 1
Item 2
Item 3
<Stack
  direction="row"
  justifyContent="center"
  alignItems="center"
  spacing={2}
>