pnpm i @wfkit/elshot
import { createElShot, ElShot } from '@wfkit/elshot'
// defautl
const shot = createElShot({
name: 'html-to-image',
url: `https://www.unpkg.com/html2canvas`,
})
// or html2canvas
const shot = createElShot({
name: 'html2canvas',
url: `https://www.unpkg.com/html-to-image`,
})
// or custom
const shot = createElShot({
name: '<provider name>',
url: `<provider script url>`,
toCanvas: (el, options) => {
// ...
},
})
// or
shot.toCanvas(el, options)
MIT © YDWF.COM