在flex容器中进行反应选择

编程入门 行业动态 更新时间:2024-10-24 16:23:27
本文介绍了在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容器中进行反应选择

本文发布于:2023-10-07 12:58:35,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469452.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:容器   flex

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!