mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-06 03:58:05 +08:00
26 lines
517 B
JavaScript
26 lines
517 B
JavaScript
import { VantComponent } from '../common/component';
|
|
VantComponent({
|
|
relation: {
|
|
name: 'row',
|
|
type: 'ancestor'
|
|
},
|
|
props: {
|
|
span: Number,
|
|
offset: Number
|
|
},
|
|
data: {
|
|
style: ''
|
|
},
|
|
methods: {
|
|
setGutter: function setGutter(gutter) {
|
|
var padding = gutter / 2 + "px";
|
|
var style = gutter ? "padding-left: " + padding + "; padding-right: " + padding + ";" : '';
|
|
|
|
if (style !== this.data.style) {
|
|
this.set({
|
|
style: style
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}); |