Open dncmaduro opened 2 months ago
The same thing happened to me, but I solved it like this
in script setup create const multiplePicker = ref<DatePickerContext | null>(null) and watch
const multiplePicker = ref<DatePickerContext | null>(null) watch(() => props.modelValue, async () => { if (multiplePicker.value) await multiplePicker.value.moveToValue('start') })
in component add ref="multiplePicker"
<VCalendarDatePicker v-if="date && (typeof date === 'object')" ref="multiplePicker" v-model.range="date" :columns="2" v-bind="{ ...attrs, ...$attrs }" />
execute the moveToValue function so that v-calendar updates the calendar
Environment
Version
v2.18.2
Reproduction
Just a small question, no need to reproduce
Description
This is my DatePicker component
And I use this component like this:
When I click the button, the DatePicker is shown but the label of the Button is not change. I still don't know that caused by the date is not changed or I set the label of the button wrongly. But when I put a
console.log
inside theset()
, it does not run.Additional context
No response
Logs
No response