声明:本站文章均为作者个人原创,图片均为实际截图。如有需要请收藏网站,禁止转载,谢谢配合!!!

1、安装

npm install js-table2excel

2、使用

import table2excel from 'js-table2excel'

const column = [
    {
        title: 'ID',
        key: 'id',
        type: 'text'
    },
    {
        title: '名字',
        key: 'name',
        type: 'text'
    },
    {
        title: '图片',
        key: 'image',
        type: 'image'
    },
]

const datas = [
{id:1, name: '八点博客1',image: 'http://1.png'},
{id:2, name: '八点博客2',image: 'http://2.png'},
];   //表单数据

const excelName = '八点博客'             //文件名称

table2excel(column, datas, excelName)



点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论