<Card cumulateContainerRange={(width, height) => { this.setState({ chartStyle: { width: width, height: height } }) }}> <div>其他自定义内容区域,高度是x</div> <Chart forceFit={false} width={this.chartStyle.width} height={this.chartStyle.height - x} padding={[20, 50, 20, 50]}></Chart> </Card> // Card 相关 componentDidMount(){ this.props.cumulateContainerRange(this.refs.custom_card_container.clientWidth, this.refs.custom_card_container.clientHeight) } <div ref="custom_card_container"> </div>
原文:https://www.cnblogs.com/lskzj/p/12666769.html