In my Vuetify App, I have implemented a Vue2Editor using a custom component called text-editor
. Here is how it looks:
<vue-editor
:value="text"
@input="updateText"
></vue-editor>
The props for this component are defined as follows:
props: {
text: {
type: String,
required: true
}
},
To perform validation, I am utilizing the parent component by applying v-model attribute (necessary for VeeValidate):
<text-editor
:text="UnitData.Details"
v-model="UnitData.Details"
@updateText="UnitData.Details = $event"
data-vv-name="details"
v-validate="'required|min:100'"
/>
Currently, both text
and v-model
contain the same values. I attempted to pass v-model as a prop into my child component using vModel
, but encountered issues. Any helpful suggestions on how to avoid duplicate code in this scenario?