<template>
    <view :class="'custom-class ' + utils.bem('col', [span]) + ' ' + (offset ? 'van-col--offset-' + offset : '')" :style="viewStyle">
        <slot />
    </view>
</template>
<script module="utils" lang="wxs" src="@/node_modules/@vant/weapp/dist/wxs/utils.wxs"></script>
<script>
import { VantComponent } from '../common/component';
export default {
    data() {
        return {
            viewStyle: ''
        };
    },
    '../row/index': {
        name: 'row',
        type: 'ancestor',
        current: 'col'
    },
    props: {
        span: Number,
        offset: Number
    },
    methods: {
        setGutter(gutter) {
            const padding = `${gutter / 2}px`;
            const viewStyle = gutter ? `padding-left: ${padding}; padding-right: ${padding};` : '';
            if (viewStyle !== this.viewStyle) {
                this.setData({
                    viewStyle
                });
            }
        }
    }
};
</script>
<style>
@import './index.css';
</style>
