1.0.1 • Published 2 years ago

export-img v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

纯前端实现 excel 导出带有图片功能

  1. 安装依赖
npm i export-img
  1. 在需要使用的地方引入依赖
import export from 'export-img'
  1. 文件封装了一些导出的方法
import export from 'export-img'
<!-- exportExcel作为导出函数 -->
const {exportExcel} from export
<!--  使用方法 -->
exportExcel(theadData,tbodyData,name,width,height)
  1. 参数介绍 exportExcel 函数里面有 5 个参数其中有三个参数是必填 theadData 是表头展示数据 ,(必填) 类型是 Array tbodyData 是表格展示的数据,(必填)类型是 Array name 是导出文件的名字 (必填)String width 是自定义图片的 width (默认值是 120),height 是自定义图片的 height(80) 数据类型是 Number