import { createNamespace } from '../utils'; import { ChildrenMixin } from '../mixins/relation'; const [createComponent, bem] = createNamespace('col'); export default createComponent({ mixins: [ChildrenMixin('vanRow')], props: { span: [Number, String], offset: [Number, String], tag: { type: String, default: 'div', }, }, emits: ['click'], computed: { style() { const { index } = this; const { spaces } = this.parent || {}; if (spaces && spaces[index]) { const { left, right } = spaces[index]; return { paddingLeft: left ? `${left}px` : null, paddingRight: right ? `${right}px` : null, }; } }, }, methods: { onClick(event) { this.$emit('click', event); }, }, render() { const { span, offset } = this; return ( {this.$slots.default?.()} ); }, });