mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
25 lines
591 B
JavaScript
25 lines
591 B
JavaScript
import { VantComponent } from '../common/component';
|
|
VantComponent({
|
|
relation: {
|
|
name: 'row',
|
|
type: 'ancestor',
|
|
current: 'col',
|
|
},
|
|
props: {
|
|
span: Number,
|
|
offset: Number
|
|
},
|
|
data: {
|
|
viewStyle: ''
|
|
},
|
|
methods: {
|
|
setGutter(gutter) {
|
|
const padding = `${gutter / 2}px`;
|
|
const viewStyle = gutter ? `padding-left: ${padding}; padding-right: ${padding};` : '';
|
|
if (viewStyle !== this.data.viewStyle) {
|
|
this.setData({ viewStyle });
|
|
}
|
|
}
|
|
}
|
|
});
|