将dom导出为word 、excel


ceshi(){             this.ToWorld();             this.ToExcel();         },         base64(content){             return window.btoa(unescape(encodeURIComponent(content)));         },         ToWorld(){             var worldContent = $('#statementBox').html();//NumberFormatLocal = "@"style='mso-number-format: @;'             var worldFile = ``             worldFile += `             worldFile += `测试`             worldFile += worldContent;             worldFile += ``;             worldFile +=""             console.log(worldContent)             var link = "data:application/vnd.ms-world;base64," + this.base64(worldFile);             var a = document.createElement("a");             a.download = "测试.doc";             a.href = link;             a.click();         },         ToExcel(){             var excelContent = $('#statementBox').html();//NumberFormatLocal = "@"style='mso-number-format: @;'             var excelFile = "";             excelFile += "";             excelFile += "测试";             excelFile += excelContent;             excelFile += "";             excelFile += "";             var link = "data:application/vnd.ms-excel;base64," + this.base64(excelFile);             var a = document.createElement("a");             a.download = "测试.xls";             a.href = link;             a.click();         },
vue