Skip to content

tkitesy/files-group

Repository files navigation

files group

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
);

groups

为分组定义

option

配置项

描述名称类型默认值
表格边框样式 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) {}

initFiles

为初始化的已经分组文件

渲染返回对象

getGroupedFiles 获取已分组文件

getErrors 获取校验结果

About

文件拖拽分类

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published