GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - yz1311/taro-signature-pad: taro3中支持手写签名的库

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
lib
lib
 
 
types
types
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
README.md
README.md
 
 
index.ts
index.ts
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

taro-signature-pad

npm version npm version

taro的手写签名库

只支持taro3小程序,h5没有做兼容处理,只支持Canvas type="2d"

安装

npm install @yz1311/taro-signature-pad --save

使用

import {SignaturePad} from "@yz1311/taro-signature-pad";

...
//组件默认是100%高宽

<Signature
    className="signature-canvas"
    ref={signatureRef}
/>

方法

isEmpty(): boolean

判断是否签名是空白的

fromDataURL(dataUrl, options, callback): void

还原签名数据

  • dataUrl: 图片的base64数据
  • options: 选项
  • callback: 回调方法

toDataURL(type, encoderOptions): string

获取签名数据

默认为png图片,实际调用的canvas的toDataURL函数,参考:

https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement/toDataURL

clear(): void

清空签名数据

save(): void

将签名数据转换为png图片并且保存到系统相册

截图

About

taro3中支持手写签名的库

Resources

Readme
Activity

Stars

18 stars

Watchers

1 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

Generated from yz1311/taro-utils
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.