Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

149
Views
vue how to add attributes to vcalendar

I'm using the vcalendar for my vue-app. So far it works ok but when I try to add some attributes, they don't apply

here is my code:

<v-calendar :attributes="attributes" :available-dates="availableDates" @dayclick="dayClicked" />

then I do this:

computed: {
  attributes() {
    return this.availableDates.map((date) => ({
       dot: {
         backgroundColor: '#FF0000',
       },
    }))
  },
}

but nothing happens and I don't know why. Can someone maybe help me out?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

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

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!