js html生成图片 下载依赖 npm install html2canvas 引入依赖 import html2canvas from "html2canvas" 代码 export const handleHtml2Img = async (el, options = {}) => { let canvas = await new html2canvas(el, options); let imgUrl = canvas.toDataURL(); return imgUrl }