add gutter to Row and Col

add gutter to Row and Col
This commit is contained in:
梁灏 2016-10-31 22:28:13 +08:00
parent e3a12bd330
commit d2203972af
7 changed files with 105 additions and 26 deletions

View file

@ -1,5 +1,5 @@
<template>
<div :class="classes">
<div :class="classes" :style="styles">
<slot></slot>
</div>
</template>
@ -17,6 +17,11 @@
pull: [Number, String],
className: String
},
data () {
return {
gutter: 0
}
},
computed: {
classes () {
return [
@ -30,6 +35,17 @@
[`${this.className}`]: !!this.className
}
]
},
styles () {
let style = {};
if (this.gutter !== 0) {
style = {
paddingLeft: this.gutter / 2 + 'px',
paddingRight: this.gutter / 2 + 'px'
}
}
return style;
}
}
}