@metalsadman Thanks, I deleted my initial reply because I thought it worked but then it didn’t. I fiddle around with what you told me, and for potential future readers, this is how I got it to work:
The component:
<template>
<q-input stack-label :label="label" v-model="date">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy>
<q-date
:value="date"
@input="updateDate($event)"
mask="YYYY-MM-DD"
></q-date>
</q-popup-proxy>
</q-icon>
</template>
</q-input>
</template>
<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
name: 'DateInput',
props: ['value', 'label'],
data() {
return {
date: this.value
};
},
methods: {
updateDate(date: string) {
this.date = date;
this.$emit('input', this.date);
}
}
});
</script>
How I use it:
<date-input :label="$t('date')" v-model="document.date" />
Thanks again!