JS 写入并下载文件

    //下载文件
                DownloadFile(row) {
                    let a = document.createElement('a');
                    a.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(row.APIContent);
                    a.download = row.APIName + ".md";
                    document.body.appendChild(a);
                    a.click();
                    document.body.removeChild(a);
                },

  

原文地址:https://www.cnblogs.com/dare/p/15751801.html