nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.32k stars 840 forks source link

Vue warn]: Duplicate keys found during update using multiple dots with same date #1473

Closed WouS95 closed 1 month ago

WouS95 commented 1 month ago

Using the following code the expected behaviour happens, except for a vue warning saying the id is not unique.

What i want to happen: When i have multiple dates that are the same day in the attributes variable I want to add multiple dots to that day.

What happens: Multiple dots are added as expected, however a Vue warning shows that the id's are not unique.

Is there a way to fix this warning? Thanks!

<template>
    <DatePicker v-model="date" view="monthly" :attributes />
</template>

<script lang="ts" setup>
import { DatePicker } from 'v-calendar';
import { ref } from 'vue';
const date = ref(new Date()); // default date is today
const attributes = ref([
    {
        dot: true,
        dates: [1714740696 * 1000, 1714740699 * 1000],
    }
]);
</script>
WouS95 commented 1 month ago

Fixed by adding a key to the attributes.

const attributes = ref([
    {
        dot: true,
        dates: [1714740699 * 1000, 1714740696 * 1000],
        key: 'dot'

    }
]);