require signature in form

This commit is contained in:
Alex Turchyn
2023-06-24 17:15:36 +03:00
parent a258ca6c79
commit 2c0bed9823
4 changed files with 21 additions and 5 deletions
@@ -70,11 +70,20 @@ export default {
}
},
emits: ['attached', 'update:model-value'],
data () {
return {
isSignatureStarted: false
}
},
mounted () {
this.$refs.canvas.width = this.$refs.canvas.parentNode.clientWidth
this.$refs.canvas.height = this.$refs.canvas.parentNode.clientWidth / 3
this.pad = new SignaturePad(this.$refs.canvas)
this.pad.addEventListener('beginStroke', () => {
this.isSignatureStarted = true
})
},
methods: {
remove () {
@@ -82,6 +91,8 @@ export default {
},
clear () {
this.pad.clear()
this.isSignatureStarted = false
},
submit () {
if (this.modelValue) {