提示“这可能不是你的错”


  • 0

    回复: #9 百分比换算器
    class Input extends Component {
    render () {
    return (
    <div>
    <input type='number' />
    </div>
    )
    }
    }

    class PercentageShower extends Component {
    constructor(props){
    super(props);
    }

    toPercent=(point)=>{
    var str=(point*100).toFixed(2);
    str+="%";
    return str;
    }

    render () {
    var result= toPercent(this.props.inputValue)
    return (
    <div>{result}</div>
    )
    }
    }

    class PercentageApp extends Component {
    constructor(props){
    super(props)
    }
    handleChange=(e)=>{
    this.setState({
    inputValue:inputValue
    })
    }

    render () {
    return (
    <div>
    <Input handleChange={this.props.handleChange}/>
    <PercentageShower inputValue={this.state.inputValue}/>
    </div>
    )
    }
    }


登录后回复
 

与 ScriptOJ 的连接断开,我们正在尝试重连,请耐心等待