I use Quasar in a Vue2.JS project. I have a QDate, linked with a QPopupEdit ( with a cancel and a set button ). I want to run a specific function when clicking set. If a condition is true, i want to cancel this setting without masking the QDate and the QPopupEdit.
Here the code :
<QPopupEdit
v-model="displayBirthday"
buttons
:label-set="$t('set')"
:label-cancel="$t('cancel')"
>
<QDate
:ref="'test'"
v-model="displayBirthday"
minimal
class="no-shadow"
mask="DD/MM/YYYY"
:locale="locale"
/>
</QPopupEdit>
Thanks.
To execute a function when you click save or close, for that, according to the documentation, you need to implement the "validate" property to the "QPopupEdit" component and if you want to show the validation error to the element you use, you need to add the "error" and "properties. error-message "I attach an example
https://jsfiddle.net/idkc/2Ltgs3dp/45/