index.js
836 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { VantComponent } from '../common/component';
VantComponent({
relation: {
name: 'row',
type: 'ancestor'
},
props: {
span: Number,
offset: Number
},
data: {
style: ''
},
computed: {
classes: function classes() {
var _this$data = this.data,
span = _this$data.span,
offset = _this$data.offset;
return this.classNames('custom-class', 'van-col', {
["van-col--" + span]: span,
["van-col--offset-" + offset]: offset
});
}
},
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.setData({
style: style
});
}
}
}
});