UNPKG

lulouis-vant

Version:

Lightweight Mobile UI Components built on Vue

39 lines (36 loc) 845 B
import { use } from '../utils'; var _use = use('row'), sfc = _use[0], bem = _use[1]; export default sfc({ props: { type: String, align: String, justify: String, tag: { type: String, default: 'div' }, gutter: { type: [Number, String], default: 0 } }, render: function render(h) { var _bem; var align = this.align, justify = this.justify; var flex = this.type === 'flex'; var margin = "-" + Number(this.gutter) / 2 + "px"; var style = this.gutter ? { marginLeft: margin, marginRight: margin } : {}; return h(this.tag, { "style": style, "class": bem((_bem = { flex: flex }, _bem["align-" + align] = flex && align, _bem["justify-" + justify] = flex && justify, _bem)) }, [this.$slots.default]); } });