🖋 Vue Signature Pad Component
Vue component wrap for signature pad
$ yarn add vue-signature-pad
import Vue from 'vue'; import VueSignaturePad from 'vue-signature-pad';Vue.use(VueSignaturePad);
vue-signature-pad use szimek/signature_pad default setting as
options, feel free custom you wanted options. In v1.1 add
onBeginand
onEndevent callback:
| Name | Type | Default | Description | Example | | :---------- | :----- | :------------------------------------------------------------------------------------------------------ | :--------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ | | width | String |
100%| Set the
divwidth. | - | | height | String |
100%| Set the
divheight. | - | | options | Object | Reference | Set the signature pad options. | Reference | | images | Array |
[]| Merge signature with the provide images. |
['A.png', 'B.png', 'C.png']or
[{ src: 'A.png', x: 0, y: 0 }, { src: 'B.png', x: 0, y: 10 }, { src: 'C.png', x: 0, y: 20 }]| | customStyle | Object |
{}| Custom
divstyle. |
{ border: black 3px solid }|
| Name | Argument Type | Description | | :------------------------------------- | :--------------------------- | --------------------------------------------------------------------------- | |
saveSignature(type, encoderOptions)|
(String, Number)| Will return target canvas status and data. | |
undoSignature()| - | Undo | |
clearSignature()| - | Clear | |
mergeImageAndSignature(signature)|
Objector
String| Provide
imagesas props and will merge with signature. | |
addImages(images)|
Array| Provide the images merge with signature. Reference above
imagesproperty. | |
lockSignaturePad()| - | Lock target signature pad. | |
openSignaturePad()| - | Open target signature pad. | |
getPropImagesAndCacheImages()| - | Get all the images information. | |
clearCacheImages()| - | Clear cache images. | |
fromDataURL(data, options, callback)|
(String, Object, Callback)| Draw image from data URL. | |
fromData(data)|
String| Returns signature image as an array of point groups. | |
toData()| - | Draws signature image from an array of point groups. | |
isEmpty()| - | Return signature canvas have data. |
szimek/signature_pad - HTML5 canvas based smooth signature drawing
MIT © Peng Jie