I am working for the first time in Vue. I have a form with an ID confirmation, I need to restrict the CTRL+C, CTRL+v, and right-click copy/paste inputs.
The code of the forms is something like this:
<script>
import { validationMixin } from 'vuelidate'
data () {
return {
form: {
id_number: '',
id_number_validation: '',
},
}
},
computed: {
chunkedForm () {
return chunk([
{ label: 'ID number',
model: 'id_number',
type: 'number',
event: null,
icon: 'assignment_ind' },
{ label: 'id number validation',
model: 'id_number_validation',
type: 'number',
event: null,
icon: 'assignment_ind' },
], 2)
},
today: function () {
let currenDate = new Date()
return currentDate.toISOString()
}
},
validations: {
form: {
id_number: {
numberSerializer,
required,
minLength: minLength(6),
maxLength: maxLength(11),
validDocumentNumber
},
id_number_validation: {
numberSerializer,
required,
minLength: minLength(6),
maxLength: maxLength(11),
validDocumentNumber,
sameAsDocumentNumber: sameAs('id_number')
},
},
},
</script>
I don't know if it's possible, I am searching for a Vue function that helps me to handle these key-bindings.
The code is only a sample, maybe it has some error but it gives an idea of the form structure and how I call it.