From 9c75d45065cc57a929d037e716ddd1b8ce9c64d5 Mon Sep 17 00:00:00 2001 From: Ataris <512056026@qq.com> Date: Wed, 11 Jul 2018 17:39:25 +0800 Subject: [PATCH] add ifRow prop should add ifRow prop to control the child has any row --- Components/Grid.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Components/Grid.js b/Components/Grid.js index 98700d1..a14d2a1 100644 --- a/Components/Grid.js +++ b/Components/Grid.js @@ -8,11 +8,11 @@ import Row from './Row'; export default class GridNB extends Component { - prepareRootProps() { + prepareRootProps(ifRow = this.ifRow()) { var type = { flex: 1, - flexDirection: this.ifRow() ? 'column' : 'row' + flexDirection: ifRow ? 'column' : 'row' } var defaultProps = { @@ -43,7 +43,7 @@ export default class GridNB extends Component { this._root = component} {...this.props} - {...this.prepareRootProps()} + {...this.prepareRootProps(this.props.ifRow)} >{this.props.children} ); @@ -53,7 +53,7 @@ export default class GridNB extends Component { this._root = component} {...this.props} - {...this.prepareRootProps()} + {...this.prepareRootProps(this.props.ifRow)} >{this.props.children} ); }