现在我尝试过的是
const options = [
{ value: 'chocolate', label: 'Chocolate' },
{ value: 'strawberry', label: 'Strawberry' },
{ value: 'vanilla', label: 'Vanilla' }
];
handleChange = (selectedOption) => {
this.setState({ selectedOption });
console.log(`Option selected:`, selectedOption);
}
const { selectedOption } = this.state;
<div className="row" style={styles}>
<div className="col-12 d-flex">
<div className="col-md-4">
<Select
value={selectedOption}
onChange={this.handleChange}
options={options}
/>
</div>
<div className="col-md-4">
<Select
value={selectedOption}
onChange={this.handleChange}
options={options}
/>
</div>
<div className="col-md-4">
<div className="add">
<button type="button" class="btn btn-primary">Primary</button>
</div>
<div className="remove">
<button type="button" class="btn btn-success">Success</button>
</div>
</div>
</div>
</div>
所以,当我尝试添加标签时,它不会出现在一行中,
谁能帮我这个 ?
提前致谢!!