Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @saber2pr/html2canvas with all npm packages installed. Try it out:

var html2canvas = require("@saber2pr/html2canvas")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@saber2pr/html2canvas v1.0.0

> 解决html2Canvas在ios13.4中失效问题 ``` // 引入 import html2canvas from "../../lib/html2canvas"; ``` ``` // 使用, 全局window对象加入html2canvas,如果没有window就调用原来的,所以需要做判断 (window.html2canvas || html2canvas)(shareContent, opts) .then(canvas => { let url = canvas.toDataURL("image/png"); console.log(url) }) .catch(err => { // do sth }); ```

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free