mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Initial commit
This commit is contained in:
55
packages/col/src/col.vue
Normal file
55
packages/col/src/col.vue
Normal file
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<div class="el-col"
|
||||
:class="[
|
||||
'el-col-' + span,
|
||||
offset ? 'el-col-offset-' + offset : '',
|
||||
pull ? 'el-col-pull-' + pull : '',
|
||||
push ? 'el-col-push-' + push : ''
|
||||
]"
|
||||
v-bind:style="style"
|
||||
>
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: 'ElCol',
|
||||
|
||||
props: {
|
||||
span: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
offset: {
|
||||
type: Number
|
||||
},
|
||||
pull: {
|
||||
type: Number
|
||||
},
|
||||
push: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
gutter() {
|
||||
return this.$parent.gutter;
|
||||
},
|
||||
style() {
|
||||
var ret = {};
|
||||
|
||||
if (this.gutter) {
|
||||
ret.paddingLeft = this.gutter / 2 + 'px';
|
||||
ret.paddingRight = ret.paddingLeft;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user