It's occurring error when I am using v-model.trim with Calendar
<Calendar id="birth_date" v-model.trim="employeeSetup.birth_date" :showButtonBar="true" required="true" :class="{'p-invalid': submitted && !employeeSetup.birth_date}" ref="birth_date" v-on:keyup.enter="this.$refs.gender.$el.focus()" />
But it's working perfectly when I am using v-model.trim with InputText
trim
is a modifier that removes any extra space in your input text :
<input type="text" v-model.trim="name" />
it uses the js function trim()
of strings :
let s="brahim "
console.log(s+'boussadjra')
let t=s.trim() //removes the space
console.log(t+'boussadjra')
the calendar is a custom component which is not a simple input