vue 使用 js-file-download

1、安装 js-file-download

npm install js-file-download

2、引入

import fileDownload from 'js-file-download';

3、使用

download() {
    this.$api.fileDownload().then(res => {
           fileDownload(res.data, 'deviceModel.xlsx');
       });
}

————————————————
版权声明:本文为CSDN博主「小蒜瓣」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/messicr7/article/details/108227961

posted @ 2022-11-08 11:49  Chaplink  阅读(731)  评论(0编辑  收藏  举报