vant-fork
Version:
Lightweight Mobile UI Components built on Vue
46 lines (42 loc) • 982 B
JavaScript
import create from '../utils/create';
export default create({
render: function render() {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c(_vm.tag, {
tag: "component",
class: _vm.b((_obj = {
flex: _vm.flex
}, _obj["align-" + _vm.align] = _vm.flex && _vm.align, _obj["justify-" + _vm.justify] = _vm.flex && _vm.justify, _obj)),
style: _vm.style
}, [_vm._t("default")], 2);
var _obj;
},
name: 'row',
props: {
type: String,
align: String,
justify: String,
tag: {
type: String,
default: 'div'
},
gutter: {
type: [Number, String],
default: 0
}
},
computed: {
flex: function flex() {
return this.type === 'flex';
},
style: function style() {
var margin = "-" + Number(this.gutter) / 2 + "px";
return this.gutter ? {
marginLeft: margin,
marginRight: margin
} : {};
}
}
});