[Vuejs]-Vue how to add attributes to vcalendar

0👍

I’m assuming you’re trying to add a dot under all available dates in v-calendar.

attributes does not need to be computed. It should just be a data property that refers to availableDates (not mapped from it):

export default {
  data() {
    const availableDates = [ new Date() ]
    return {
      availableDates,
      attributes: [
        {
          dot: true,
          dates: availableDates,
        },
      ],
    }
  },
}

Since attributes.dates refers to availableDates, any changes to availableDates is automatically reflected in the attributes binding.

demo

Leave a comment