build 中为以构建文件 index.html 中为基本例子
导入组件库文件
<link rel="stylesheet" type="text/css" href="build/index.css" />
<script src="build/index.js"></script>
初始化组件
var ret = renderFilesGroup(
document.getElementById("root"),
groups,
option,
initFiles
);
为分组定义
配置项
描述 | 名称 | 类型 | 默认值 | |
---|---|---|---|---|
表格边框样式 | borderStyle | string | '1px solid #555' | |
分类列宽 | groupWidth | string | "10%" | |
说明列宽 | descWidth | string | "20%" | |
文件列宽 | dropWidth | string | "35%" | |
上传共享区列宽 | uploadWidth | string | "35%" | |
分类列文本 | groupLabel | string | "要件类别" | |
说明列文本 | descLabel | string | "说明" | |
文件列文本 | dropLabel | string | "拖放选择" | |
上传列文本 | uploadLabel | string | "点击上传" | |
可选的文件类型 | accept | string | 'image/*' | |
文件项的宽度 | itemWidth | number | 80 | |
文件项的高度 | itemHeight | number | 120 | |
变化检测 | onChange | function | function(files, errors) {} |
为初始化的已经分组文件
getGroupedFiles 获取已分组文件
getErrors 获取校验结果