fixed #1661
This commit is contained in:
parent
b9541c05ca
commit
9eec7f1660
3 changed files with 31 additions and 14 deletions
|
@ -1,16 +1,26 @@
|
|||
<style>
|
||||
.demo-col div{
|
||||
background: #f50;
|
||||
.ivu-col div{
|
||||
background: rgba(0,153,229,.7);
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div>
|
||||
<Row :gutter="16">
|
||||
<i-col class-name="demo-col" span="4" v-for="i in n" key="i">
|
||||
<div>col-8</div>
|
||||
</i-col>
|
||||
<Row :gutter="64">
|
||||
<Card>
|
||||
<i-col span="6">
|
||||
<div>col-6</div>
|
||||
</i-col>
|
||||
<i-col span="6">
|
||||
<div>col-6</div>
|
||||
</i-col>
|
||||
<i-col span="6">
|
||||
<div>col-6</div>
|
||||
</i-col>
|
||||
<i-col span="6">
|
||||
<div>col-6</div>
|
||||
</i-col>
|
||||
</Card>
|
||||
</Row>
|
||||
<Button @click="add">add</Button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { findComponentUpward } from '../../utils/assist';
|
||||
const prefixCls = 'ivu-col';
|
||||
|
||||
export default {
|
||||
|
@ -70,7 +71,10 @@
|
|||
},
|
||||
methods: {
|
||||
updateGutter () {
|
||||
this.$parent.updateGutter(this.$parent.gutter);
|
||||
const Row = findComponentUpward(this, 'Row');
|
||||
if (Row) {
|
||||
Row.updateGutter(Row.gutter);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { oneOf } from '../../utils/assist';
|
||||
import { oneOf, findComponentsDownward } from '../../utils/assist';
|
||||
|
||||
const prefixCls = 'ivu-row';
|
||||
|
||||
|
@ -58,11 +58,14 @@
|
|||
},
|
||||
methods: {
|
||||
updateGutter (val) {
|
||||
this.$children.forEach((child) => {
|
||||
if (val !== 0) {
|
||||
child.gutter = val;
|
||||
}
|
||||
});
|
||||
const Cols = findComponentsDownward(this, 'iCol');
|
||||
if (Cols.length) {
|
||||
Cols.forEach((child) => {
|
||||
if (val !== 0) {
|
||||
child.gutter = val;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
Loading…
Add table
Reference in a new issue