You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
778 B
JavaScript
45 lines
778 B
JavaScript
export default {
|
|
name: 'ElRow',
|
|
|
|
componentName: 'ElRow',
|
|
|
|
props: {
|
|
tag: {
|
|
type: String,
|
|
default: 'div'
|
|
},
|
|
gutter: Number,
|
|
type: String,
|
|
justify: {
|
|
type: String,
|
|
default: 'start'
|
|
},
|
|
align: String
|
|
},
|
|
|
|
computed: {
|
|
style() {
|
|
const ret = {};
|
|
|
|
if (this.gutter) {
|
|
ret.marginLeft = `-${this.gutter / 2}px`;
|
|
ret.marginRight = ret.marginLeft;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
},
|
|
|
|
render(h) {
|
|
return h(this.tag, {
|
|
class: [
|
|
'el-row',
|
|
this.justify !== 'start' ? `is-justify-${this.justify}` : '',
|
|
this.align ? `is-align-${this.align}` : '',
|
|
{ 'el-row--flex': this.type === 'flex' }
|
|
],
|
|
style: this.style
|
|
}, this.$slots.default);
|
|
}
|
|
};
|