-
Notifications
You must be signed in to change notification settings - Fork 76
/
Copy pathserve.vue
65 lines (61 loc) · 1.2 KB
/
serve.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<script>
import { defineComponent } from 'vue';
import { VueSignaturePad } from '../src/entry.esm';
export default defineComponent({
name: 'ServeDev',
components: {
VueSignaturePad
},
methods: {
undo() {
this.$refs.signaturePad.undoSignature();
},
save() {
const { isEmpty, data } = this.$refs.signaturePad.saveSignature();
console.log(isEmpty);
console.log(data);
}
}
});
</script>
<template>
<div id="app">
<vue-signature-pad
id="signature"
ref="signaturePad"
width="500px"
height="500px"
/>
<div id="buttons">
<button @click="save">
Save
</button>
<button @click="undo">
Undo
</button>
</div>
</div>
</template>
<style>
#app {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
}
#buttons {
display: flex;
gap: 8px;
margin-top: 8px;
}
#signature {
border: double 3px transparent;
border-radius: 5px;
background-image: linear-gradient(white, white),
radial-gradient(circle at top left, #4bc5e8, #9f6274);
background-origin: border-box;
background-clip: content-box, border-box;
}
</style>