react-bootstrap 中的 controlId 是什么
what is a controlId in react-bootstrap
我刚刚了解了 React-bootstrap form controlId
的用途是什么,它与我们在传统形式中使用的 name
相似吗?
<form>
<FormGroup
controlId="formBasicText" ---------------------->> what is the use?
validationState={this.getValidationState()}
>
<ControlLabel>Working example with validation</ControlLabel>
<FormControl
type="text"
value={this.state.value}
placeholder="Enter text"
onChange={this.handleChange}
/>
<FormControl.Feedback />
<HelpBlock>Validation is based on string length.</HelpBlock>
</FormGroup>
</form>
正如 DOCS 所说:
Sets id on <FormControl>
and htmlFor
on <FormGroup.Label>
.
基本上是输入的 id
和标签的 for
属性。
我刚刚了解了 React-bootstrap form controlId
的用途是什么,它与我们在传统形式中使用的 name
相似吗?
<form>
<FormGroup
controlId="formBasicText" ---------------------->> what is the use?
validationState={this.getValidationState()}
>
<ControlLabel>Working example with validation</ControlLabel>
<FormControl
type="text"
value={this.state.value}
placeholder="Enter text"
onChange={this.handleChange}
/>
<FormControl.Feedback />
<HelpBlock>Validation is based on string length.</HelpBlock>
</FormGroup>
</form>
正如 DOCS 所说:
Sets id on
<FormControl>
andhtmlFor
on<FormGroup.Label>
.
基本上是输入的 id
和标签的 for
属性。