[英]Why all react components changes height instead of one
我正在制作一個 Trello 副本,並且我已經渲染了幾次組件,並且我在組件末尾有一個按鈕,它應該更改 state 並用另一個按鈕顯示輸入字段,如下所示:單擊之前
但問題是,當我單擊“添加另一個項目”時,所有組件的高度都會發生變化,如下所示:單擊后
但它應該只適用於一個,有什么想法嗎?
Css 集裝箱代碼:
listCointainer: {
display: 'flex',
justifyContent: 'flex-start',
},
和列表:
list: {
minWidth: '300px',
backgroundColor: '#EBECF0',
margin: '10px',
paddingBottom: '10px',
},
利用
list: {
minWidth: '300px',
backgroundColor: '#EBECF0',
margin: '10px',
paddingBottom: '10px',
height: 'fit-content'
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.