1. file-saver(文件下载) 网址:https://www.npmjs.com/package/file-saver
安装:
npm install file-saver --save
引用:
import { saveAs } from 'file-saver';
用法:
// txt
var FileSaver = require('file-saver'); var blob = new Blob(["Hello, world!"], {type: "text/plain;charset=utf-8"}); FileSaver.saveAs(blob, "hello world.txt");
// 图片什么的
FileSavercanvas
var canvas = document
canvas
File
var file =
FileSaver
2. 生成二维码
QRCode
3. 一维码
JsBarcode