first
This commit is contained in:
9
packages/row/index.js
Normal file
9
packages/row/index.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import Row from './src/row';
|
||||
|
||||
/* istanbul ignore next */
|
||||
Row.install = function(Vue) {
|
||||
Vue.component(Row.name, Row);
|
||||
};
|
||||
|
||||
export default Row;
|
||||
|
47
packages/row/src/row.js
Normal file
47
packages/row/src/row.js
Normal file
@@ -0,0 +1,47 @@
|
||||
export default {
|
||||
name: 'ElRow',
|
||||
|
||||
componentName: 'ElRow',
|
||||
|
||||
props: {
|
||||
tag: {
|
||||
type: String,
|
||||
default: 'div'
|
||||
},
|
||||
gutter: Number,
|
||||
type: String,
|
||||
justify: {
|
||||
type: String,
|
||||
default: 'start'
|
||||
},
|
||||
align: {
|
||||
type: String,
|
||||
default: 'top'
|
||||
}
|
||||
},
|
||||
|
||||
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 !== 'top' ? `is-align-${this.align}` : '',
|
||||
{ 'el-row--flex': this.type === 'flex' }
|
||||
],
|
||||
style: this.style
|
||||
}, this.$slots.default);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user