// 导出表格为excel格式
export default{
  install (Vue, options) {
    Vue.prototype.exportData = function () {
      var title = this.tableTitle
      let tHeader = [];
        let filterVal = [];
        this.$refs.excelDom.dataColumnData.filter( (item,i) =>{
          tHeader.push(item.label);
              filterVal.push(item.prop);
          } )
      //导出为excel
      this.downloadLoading = true
      require.ensure([], () => {
      const { export_json_to_excel } = require("@/assets/excel/Export2Excel.js"); //这里必须使用绝对路径，使用@/+存放export2Excel的路径
      let list = this.$refs.excelDom.dataTabel;
      let data = list.map((v) => filterVal.map((j) => v[j]));//3.formatJson格式转换
      export_json_to_excel(tHeader, data, title); // (title)导出的表格名称
    });
    }
  },
}