工具 & 库

html2canvas

async function createPoster() {
  const element = document.getElementById('html2canvas') as HTMLElement
  const options = {
    dpi: window.devicePixelRatio * 300,
    useCORS: true,
    width: 375,
    height: 667,
  }
  if (window.html2canvas) {
    window
      .html2canvas(element, options)
      .then((canvas: any) => {
        posterUrl.value = canvas.toDataURL('image/png')
      })
      .catch((error: any) => {
        console.log('error', error)
      })
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

生成二维码

图片压缩

省市区数据

Cmder

widow下的命令行工具

Last Updated: 2022/6/23 14:25:22
Contributors: 黎聪, licong23@xdf.cn