feat(Grid): add direction prop (#6256)

This commit is contained in:
neverland
2020-05-11 15:47:55 +08:00
committed by GitHub
parent 67716c65e3
commit 45f3c9e759
7 changed files with 96 additions and 25 deletions
+13
View File
@@ -77,6 +77,18 @@ Vue.use(GridItem);
</van-grid>
```
### 内容横排
`direction`属性设置为`horizontal`,可以让宫格的内容呈横向排列
```html
<van-grid direction="horizontal" :column-num="2">
<van-grid-item icon="photo-o" text="文字" />
<van-grid-item icon="photo-o" text="文字" />
<van-grid-item icon="photo-o" text="文字" />
</van-grid>
```
### 页面导航
通过`to`属性设置`vue-router`跳转链接,通过`url`属性设置 URL 跳转链接
@@ -112,6 +124,7 @@ Vue.use(GridItem);
| center | 是否将格子内容居中显示 | _boolean_ | `true` |
| square | 是否将格子固定为正方形 | _boolean_ | `false` |
| clickable | 是否开启格子点击反馈 | _boolean_ | `false` |
| direction `v2.8.2` | 格子内容排列的方向,可选值为 `horizontal` | _string_ | `vertical` |
### GridItem Props