【问题标题】:How to set custom width for react-select如何为反应选择设置自定义宽度
【发布时间】:2020-08-10 15:29:06
【问题描述】:

您好,有没有办法在我的反应选择按钮中设置自定义宽度? 如果我可以使用引导程序来做到这一点,我希望它可以响应,但如果不是也可以。

这是我的代码:

import Select, { components } from 'react-select';
export default class AccomodationType extends Component {

    render() {
        const options = [
            { value: 'chocolate', label: 'Chocolate' },
            { value: 'strawberry', label: 'Strawberry' },
            { value: 'vanilla', label: 'Vanilla' }
          ]
        return(
            <div>
                <Select
                options= {options}
                isClearable
                isSearchable
                name="color"
            />
                </div>



        )


    }


}

【问题讨论】:

    标签: css reactjs styles react-select


    【解决方案1】:

    我只是使用了引导调整大小!

    这是我添加的内容:

    
                    <Select
                    className="w-25 p-3"
                    options= {options}
                    isClearable
                    isSearchable
                    name="color"
                />
    
    

    【讨论】:

      猜你喜欢
      • 2019-05-13
      • 2016-12-10
      • 2014-04-28
      • 2014-08-13
      • 2021-09-07
      • 2019-09-30
      • 2016-08-09
      • 1970-01-01
      相关资源
      最近更新 更多