前端下载并读取excel并转成对象数组array
xlsx.js可以读取excel,可以使用前端下载下excel文件,并将其中内容转为对象数组,方便处理。例如,在vue-cli3.0或4.0中,将excel作为静态文件,放到public下,通过路径可以访问到。其中axios请求到的文件格式为arraybufferaxios({ method: "get", url: "文件名.xlsx", responseType: "arraybuffer", }).then((res) =>
原创
2021-04-21 09:12:25 ·
1821 阅读 ·
0 评论