本文介绍了在flex容器中进行反应选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何进行反应选择以尊重柔性版式?以下内容均无效.
How can I make react-select to respect flex layout? Nothing of the below worked.
const Container = styled('div')` width: 100%; height: 100%; display: flex; flex-flow: row wrap; justify-content: space-around; align-items: baseline; `; const selectStyles = { input: base => ({ minWidth: 200, flex: 1, <Container> <Select style={{ flex: 1 }} styles={selectStyles}推荐答案
要使您的react-select组件灵活,您需要在容器上应用flex:1道具,如下所示:
To make your react-select component flex you need to apply flex:1 props on the container like this:
const styles = { container: base => ({ ...base, flex: 1 }) }; <Select styles={styles} />更多推荐
在flex容器中进行反应选择
发布评论