装依赖
npm install js-table2excel
vue中引入
import table2excel from "js-table2excel";
使用
const column = [
{
title: "sn",
key: "sn",
type: "text",
},
{
title: "图片",
key: "imgae",
type: "image",
width: 100,
height: 100,
},
];
const exportData = async () => {
feedback.notify('导出中,请稍后...')
table2excel(column, 数据集合List, "name");
}