mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
feat(Grid): add reverse prop (#4280)
* Update index.ts * doc(Grid): add reverse prop * feat(GridItem): reverse prop * Update index.wxml * Update index.less * Update index.less * Update style
This commit is contained in:
parent
ad4753988a
commit
41e8565ee4
@ -44,9 +44,24 @@
|
|||||||
&--horizontal {
|
&--horizontal {
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
.van-grid-item__icon + .van-grid-item__text {
|
.van-grid-item__text {
|
||||||
margin-top: 0;
|
margin: 0 0 0 @padding-xs;
|
||||||
margin-left: @padding-xs;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--reverse {
|
||||||
|
flex-direction: column-reverse;
|
||||||
|
|
||||||
|
.van-grid-item__text {
|
||||||
|
margin: 0 0 @padding-xs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&--horizontal&--reverse {
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
|
||||||
|
.van-grid-item__text {
|
||||||
|
margin: 0 @padding-xs 0 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ VantComponent({
|
|||||||
clickable,
|
clickable,
|
||||||
center,
|
center,
|
||||||
direction,
|
direction,
|
||||||
|
reverse,
|
||||||
iconSize,
|
iconSize,
|
||||||
} = data;
|
} = data;
|
||||||
|
|
||||||
@ -53,6 +54,7 @@ VantComponent({
|
|||||||
gutter,
|
gutter,
|
||||||
clickable,
|
clickable,
|
||||||
direction,
|
direction,
|
||||||
|
reverse,
|
||||||
iconSize,
|
iconSize,
|
||||||
index: children.indexOf(this),
|
index: children.indexOf(this),
|
||||||
columnNum,
|
columnNum,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
bindtap="onClick"
|
bindtap="onClick"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
class="content-class {{ utils.bem('grid-item__content', [direction, { center, square, clickable, surround: border && gutter }]) }} {{ border ? 'van-hairline--surround' : '' }}"
|
class="content-class {{ utils.bem('grid-item__content', [direction, { center, square, reverse, clickable, surround: border && gutter }]) }} {{ border ? 'van-hairline--surround' : '' }}"
|
||||||
style="{{ computed.contentStyle({ square, gutter }) }}"
|
style="{{ computed.contentStyle({ square, gutter }) }}"
|
||||||
>
|
>
|
||||||
<block wx:if="{{ useSlot }}">
|
<block wx:if="{{ useSlot }}">
|
||||||
|
@ -135,6 +135,7 @@
|
|||||||
| square | 是否将格子固定为正方形 | _boolean_ | `false` | - |
|
| square | 是否将格子固定为正方形 | _boolean_ | `false` | - |
|
||||||
| clickable | 是否开启格子点击反馈 | _boolean_ | `false` | - |
|
| clickable | 是否开启格子点击反馈 | _boolean_ | `false` | - |
|
||||||
| direction | 格子内容排列的方向,可选值为 `horizontal` | _string_ | `vertical` | - |
|
| direction | 格子内容排列的方向,可选值为 `horizontal` | _string_ | `vertical` | - |
|
||||||
|
| reverse `v1.7.0` | 是否调换图标和文本的位置 | _boolean_ | `false` |
|
||||||
| use-slot | 是否使用自定义内容的插槽 | _boolean_ | `false` |
|
| use-slot | 是否使用自定义内容的插槽 | _boolean_ | `false` |
|
||||||
|
|
||||||
### Grid 外部样式类
|
### Grid 外部样式类
|
||||||
|
@ -41,6 +41,11 @@ VantComponent({
|
|||||||
type: String,
|
type: String,
|
||||||
observer: 'updateChildren',
|
observer: 'updateChildren',
|
||||||
},
|
},
|
||||||
|
reverse: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
observer: 'updateChildren',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user