During the process of converting my VueJs project to TypeScript, I encountered an error related to TypeScript.
This issue arises from a component with a custom v-model implementation.
In the HTML, there is an input field with a 'plate' ref that I need to access the value of. The @input event on this field triggers the update method provided below.
The TypeScript error states that the value property does not exist on plate.
@Prop() value: any;
update() {
this.$emit('input',
plate: this.$refs.plate.value
});
}
Template:
<template>
<div>
<div class="form-group">
<label for="inputPlate" class="col-sm-2 control-label">Plate</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputPlate" ref="plate" :value="value.plate" @input="update">
</div>
</div>
</div>
</template>