0.0.2 • Published 1 year ago

@pluve/lego-excel-import-vue v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@pluve/lego-excel-import-vue

乐高系列之 excel 文件上传组件

npm (scoped)

@pluve/lego-excel-import-vue 已经投入了我们的生产环境中使用,经受住了来自真实业务的考验,并伴随着我们的业务需求不断完善。

安装

# 使用 npm
npm i @pluve/lego-excel-import-vue

# 使用 yarn
yarn add @pluve/lego-excel-import-vue

API

参数说明类型默认值
title导入模态框标题string批量导入
btnText导入按钮文案string批量导入
templateUrl导入模版地址string-
tableKeys配置描述Array<LegoExcelImportTableKey>-
maxLength最大一次导入行数number-
bodyTop自定义模态框内容区域底部(文件展示区域顶部)v-slot:bodyTop-
bodyBottom自定义模态框内容区域底部(文件展示区域底部)v-slot:bodyBottom-
customRequest自定义校验,一般用于业务校验(如调用后端接口校验)(data: any[]) => Promise-

LegoExcelImportTableKey

数据对象描述

参数说明类型
label表头列名称string
value表头列属性(表头列名称所对应的 key)string
rules列规则校验Array<LegoExcelImportRule>
formatter格式化该列数据(在解析excel时执行)(value?: stringnumber) => any

LegoExcelImportRule

参数说明类型
required是否必填boolean
pattern正则校验RegExp
message错误提示string
validator自定义函数校验(value: any) => Promise

使用