您可以在
onChange
handleContractValueChange(e) {
let Quarterpercentage = 0;
if(this.state.subscriptionamount > 0) {
Quarterpercentage = (this.state.subscriptionamount * e.target.value)/100;
}
this.setState({
currency: e.target.value,
Quarterpercentage
});
console.log(e.target.value);
}
你也可以这样做
handleSubscrtiptionAmountChange
.
handleSubscrtiptionAmountChange(e) {
let Quarterpercentage = 0;
if(this.state.currency > 0) {
Quarterpercentage = (this.state.currency * e.target.value)/100;
}
this.setState({
subscriptionamount: e.target.value,
Quarterpercentage
});
console.log(e.target.value);
}