import React, {Component} from 'react'; import {Input, Select, Button, Row, Col} from 'antd'; const Option = Select.Option; class TencentDeploy extends Component { constructor(props) { super(props); this.state = { configs: ['functionName', 'region', 'description', 'cosBucketName', 'cosObjectName', 'cosBucketRegion', 'vpcId', 'subnetId'], functionName: props.deploy.functionName, region: props.deploy.region, description: props.deploy.description, cosBucketName: props.deploy.cosBucketName, cosObjectName: props.deploy.cosObjectName, cosBucketRegion: props.deploy.cosBucketRegion, vpcId: props.deploy.vpcId, subnetId: props.deploy.subnetId }; } switchConfig = (label) => { return (e) => { this.setState({ [label]: e.target.value }) }; }; componentWillReceiveProps(next) { this.setState({ functionName: next.deploy.functionName, region: next.deploy.region, description: next.deploy.description, cosBucketName: next.deploy.cosBucketName, cosObjectName: next.deploy.cosObjectName, cosBucketRegion: next.deploy.cosBucketRegion, vpcId: next.deploy.vpcId, subnetId: next.deploy.subnetId }); }; render() { return (
back to choose
Deploy Config { this.state.configs.map(config => (
{config}:
)) }
) } } export default TencentDeploy;