support use transitiongroup in el-col (#4483)

pull/4491/head
baiyaaaaa 2017-04-27 13:07:29 +08:00 committed by cinwell.li
parent 3655d0be33
commit f989479961
2 changed files with 12 additions and 12 deletions

View File

@ -17,23 +17,21 @@ export default {
computed: { computed: {
gutter() { gutter() {
return this.$parent.gutter; let parent = this.$parent;
}, while (parent && parent.$options.componentName !== 'ElRow') {
parent = parent.$parent;
style() {
var ret = {};
if (this.gutter) {
ret.paddingLeft = this.gutter / 2 + 'px';
ret.paddingRight = ret.paddingLeft;
} }
return parent ? parent.gutter : 0;
return ret;
} }
}, },
render(h) { render(h) {
let { style } = this;
let classList = []; let classList = [];
let style = {};
if (this.gutter) {
style.paddingLeft = this.gutter / 2 + 'px';
style.paddingRight = style.paddingLeft;
}
['span', 'offset', 'pull', 'push'].forEach(prop => { ['span', 'offset', 'pull', 'push'].forEach(prop => {
if (this[prop]) { if (this[prop]) {

View File

@ -17,6 +17,8 @@
export default { export default {
name: 'ElRow', name: 'ElRow',
componentName: 'ElRow',
props: { props: {
gutter: Number, gutter: Number,
type: String, type: String,