vant-weapp/dist/col/index.js
2018-08-22 10:32:27 +08:00

29 lines
468 B
JavaScript

const ROW_PATH = '../row/index';
Component({
options: {
addGlobalClass: true
},
externalClasses: ['custom-class'],
relations: {
[ROW_PATH]: {
type: 'ancestor'
}
},
properties: {
span: Number,
offset: Number
},
methods: {
setGutter(gutter) {
const padding = `${gutter / 2}px`;
const style = gutter ? `padding-left: ${padding}; padding-right: ${padding};` : '';
this.setData({ style });
}
}
});