1引入
安装
标准:npm install vue-json-excel国内:yarn add vue-json-excel
main.js 入口文件
import JsonExcel from "vue-json-excel"; // 导出ponent("downloadExcel", JsonExcel);
2使用 导出
1- template 中使用<a-buttontype="primary":disabled="disabled"style="margin-bottom: 10px"@click="exportData"><download-excel:data="exportmemberList":fields="exportColumns"name="订单列表报表.xls">导出</download-excel></a-button>
2- js中//导出表头exportColumns: {订单编号: {field: "no",callback: (value) => {return " " + value;},},回收员: "recycler_name",所属区域: "area_name",完成时间: "finished_at",订单状态: "exportstatus",订单金额: "actual_price",回收员利润: "recycler_profit",},exportmemberList: [],
3vue 文件中 修改
4参数说明
5、官网
/jecovier/vue-json-excel