When I v-model a data in my Vue HTML to validate it in my form, I also want to use it in another variable. Here is my HTML code:
<input class="input-style px-3" :class="{'border-red-error':v$.categoryTitle.$errors.length>0}" type="text"
placeholder="title" :disabled="formIsSending" v-model="DataForValidating.categoryTitle">
However, my JavaScript code doesn't seem to be working:
const DataForValidating = reactive({
categoryTitle: '',
categorySlug: '',
})
const categoryFormData = {
categoryTitle: DataForValidating.categoryTitle,
categorySlug: DataForValidating.categorySlug,
}
I tried making the categoryFormData reactive as well, but it's still not functioning as expected.