我正在创建一个文档上传系统,并希望将所有已上传文档的行与最后一行作为“添加另一个文档”行。目前,带有行的列表容器没有扩展,而只是降低了列表中项目的高度。相反,我试图让父高度扩展以包含列表中的所有项目。任何帮助表示赞赏!
import React, { Component } from 'react';
export class Upload extends Component {
render() {
return (
<div style={{'height': '100vh', 'display': 'flex', 'justifyContent': 'center', alignItems: 'center'}}>
<div style={{'flex': 0.8, maxWidth: 800, flexGrow: 1, 'borderRadius': 10, 'boxShadow': '0px 0px 10px #82828240', 'paddingLeft': 50, 'paddingRight': 50, 'paddingTop': 100, 'paddingBottom': 100, display: 'flex', flexDirection: 'column'}}>
<div>
<h2>Document upload</h2>
<p>Some subtitle placeholder</p>
</div>
<hr />
<div style={{'display': 'flex','flexDirection': 'column', backgroundColor: 'red'}}>
<div style={{flex: 1, backgroundColor: 'blue', marginTop: 20, marginBottom: 20}} />
<div style={{flex: 1, flexShrink: 0, backgroundColor: 'blue', marginTop: 20, marginBottom: 20}} />
<div style={{flex: 1, flexShrink: 0, backgroundColor: 'blue', marginTop: 20, marginBottom: 20}} />
<div style={{flex: 1, flexShrink: 0, backgroundColor: 'blue', marginTop: 20, marginBottom: 20}} />
<div style={{flex: 1, flexShrink: 0, backgroundColor: 'blue', marginTop: 20, marginBottom: 20}} />
<div style={{flex: 1, flexShrink: 0, backgroundColor: 'blue', marginTop: 20, marginBottom: 20}} />
<div style={{flex: 1, flexShrink: 0, backgroundColor: 'blue', marginTop: 20, marginBottom: 20}} />
<div style={{flex: 1, flexShrink: 0, backgroundColor: 'blue', marginTop: 20, marginBottom: 20}} />
<div style={{flex: 1, flexShrink: 0, backgroundColor: 'blue', marginTop: 20, marginBottom: 20}} />
{/* <button type='button' style={{'flex': 1, flexShrink: 0, 'borderStyle': 'dashed'}} onClick={() => this.input.click()}/>
<input id='file-upload' type="file" style={{display: 'none'}} ref={(input) => this.input = input}/> */}
</div>
</div>
</div>
);
}
}
删除height: 80%
并将 更改li
为div
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句