fixed #1661
This commit is contained in:
parent
b9541c05ca
commit
9eec7f1660
3 changed files with 31 additions and 14 deletions
|
@ -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
Add a link
Reference in a new issue