import-excel
v1.0.1
Published
"前端编辑导入表格文件和压缩包文件"
Downloads
10
Readme
ImportExcel
一个支持前端上传.xlsx和.zip文件在线编辑的表格(支持拖拽上传)。
依赖于jszip,element-ui。
//引入
import {importExcel} from "@/components/ImportExcel.vue"
/**
* OrdinaryHead 传入表格的列头
* 数据格式[{name:"",width:120,type:"text"}]
* name--这一列的名字
* width--这一列的宽度
* type--列的类型支持三种(:text input框)(:select 选择器)(:image 图片格式)
* tips:当类型为选择器时需要额外传入options的对象数组[{value:"",label;""}]
* tips:当类型是image时 格式是base64格式,需要自己转换
* excelrules 可定义的表格数据校验方法
* getMyExcelData 可对传入的数据进行操作
*/
<div class="excel">
<client-only>
<import-excel>
:OrdinaryHead="OrdinaryHead"
:rules="excelrules"
:control="control"
@getResult="getMyExcelData"
</import-excel>
</client-only>
</div>