Javascript 如何更改react select Automatic react js的宽度和高度
我已经选择了元素,我想使用Javascript 如何更改react select Automatic react js的宽度和高度,javascript,html,css,reactjs,Javascript,Html,Css,Reactjs,我已经选择了元素,我想使用值更改元素的宽度和高度。长度我的代码如下所示: width: `${(8*newValue.length) + 100}px`, height: , 当宽度大于300px时,那么高度+50px我想你可以这样做 style={(8*newValue.length) + 100>300?{width: `${(8*newValue.length) + 100}px`,height:`${height + 50}px`}:{width: `${(8*newValue.
值更改元素的宽度和高度。长度我的代码如下所示:
width: `${(8*newValue.length) + 100}px`,
height: ,
当宽度
大于300px
时,那么高度+50px
我想你可以这样做
style={(8*newValue.length) + 100>300?{width: `${(8*newValue.length) + 100}px`,height:`${height + 50}px`}:{width: `${(8*newValue.length) + 100}px`,height:`${height}px`}}
这取决于用例。您可以使用引导网格系统控制它,如行
和列