refactor(Layout): enable flex by default, remove type prop

This commit is contained in:
chenjiahan
2020-10-06 17:29:02 +08:00
parent e9c2821235
commit f7a1208a18
6 changed files with 27 additions and 65 deletions
+5 -14
View File
@@ -51,36 +51,28 @@ Set grid spacing using `gutter` attribute. The default value is 0.
</van-row>
```
### Flex Layout
Setting `type` to `flex` to enable flex layout.
### Justify Content
```html
<van-row type="flex">
<van-row justify="center">
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
</van-row>
<van-row type="flex" justify="center">
<van-row justify="end">
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
</van-row>
<van-row type="flex" justify="end">
<van-row justify="space-between">
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
</van-row>
<van-row type="flex" justify="space-between">
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
</van-row>
<van-row type="flex" justify="space-around">
<van-row justify="space-around">
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
<van-col span="6">span: 6</van-col>
@@ -93,7 +85,6 @@ Setting `type` to `flex` to enable flex layout.
| Attribute | Description | Type | Default |
| --- | --- | --- | --- |
| type | Layout type, can be set to `flex` | _string_ | - |
| gutter | Grid spacingpx | _number \| string_ | - |
| tag | Custom element tag | _string_ | `div` |
| justify | Flex main axiscan be set to end/center/space-around/space-between | _string_ | `start` |