1
我試圖使用React Bootstrap和react-fa(font-awesome)將圖標添加到輸入字段。有沒有可以在Form Control組件上設置的道具?下面的代碼我插入了一個圖標,但它顯然在輸入之上而不在裏面。帶圖標的React-Bootstrap FormControl
<form>
<FormGroup
controlId="formBasicText"
validationState={this.getValidationState()}
className="login-form"
>
<ControlLabel>Email address</ControlLabel>
<Icon spin name="spinner" />
<FormControl
type="text"
value={this.state.value}
placeholder="Your email"
onChange={this.handleChange}
className="login-input"
/>
<ControlLabel>Password</ControlLabel>
<FormControl
type="text"
value={this.state.value}
placeholder="Your password"
onChange={this.handleChange}
className="login-input"
/>
<FormControl.Feedback />
</FormGroup>
<Button bsStyle="success btn-raised btn-block" bsSize="large" onClick={this.closeModal}>Let's Go</Button>
</form>
我自己想知道同樣的事情。你有沒有想出一個解決方案? –