(前端React)手写签名 react-canvas-draw

import CanvasDraw from 'react-canvas-draw'

const signCanvas = useRef<any>();
// 清空
signCanvas.current.clear()
// 获取结果
const img = signCanvas.current.canvas.drawing.toDataURL('image/png')
<div>
  <div className="backageImg">div> // 用于设置背景图片
  <CanvasDraw
    ref={signCanvas}
    backgroundColor="#f3f7fb"
    gridColor="rgba(0, 0, 0, 0)"
    brushColor="#000"
    brushRadius={3}
    lazyRadius={5}
    canvasWidth={669}
    canvasHeight={225}
  />
div>

你可能感兴趣的:(前端,React,javaScript,react.js,前端,javascript)