Js制作下载文件
偶然发现这个用coffee+jsx语法相当精简
<a download="点位示例.json" href={'data:text/json;charset=utf-8,' + encodeURIComponent JSON.stringify samplejsonfile, 0, 2 }>"参数文件示例"</a>
参考:
- https://stackoverflow.com/questions/36916368/download-object-as-formatted-json-file
- https://stackoverflow.com/questions/19721439/download-json-object-as-a-file-from-browser