UNPKG

778 BJavaScriptView Raw
1export default {
2 name: 'ElRow',
3
4 componentName: 'ElRow',
5
6 props: {
7 tag: {
8 type: String,
9 default: 'div'
10 },
11 gutter: Number,
12 type: String,
13 justify: {
14 type: String,
15 default: 'start'
16 },
17 align: String
18 },
19
20 computed: {
21 style() {
22 const ret = {};
23
24 if (this.gutter) {
25 ret.marginLeft = `-${this.gutter / 2}px`;
26 ret.marginRight = ret.marginLeft;
27 }
28
29 return ret;
30 }
31 },
32
33 render(h) {
34 return h(this.tag, {
35 class: [
36 'el-row',
37 this.justify !== 'start' ? `is-justify-${this.justify}` : '',
38 this.align ? `is-align-${this.align}` : '',
39 { 'el-row--flex': this.type === 'flex' }
40 ],
41 style: this.style
42 }, this.$slots.default);
43 }
44};