Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
'Cannot read properties of undefined events' Vue.JS
  <FullCalendar id="calendar"
  :options="calendarOptions"
  />
</section>

export default {
  components: {
    FullCalendar
  },
  
  
  data() {
    return {
      calendarOptions: {
        plugins: [dayGridPlugin ,interactionPlugin, timeGridPlugin, listPlugin],

  methods:{
    newEvent(){
      var theCalendar = document.getElementById("calendar");
      var eventName = document.getElementById("Ename").value;
      var sDate = document.getElementById("startDate").value;
      var eDate = document.getElementById("endDate").value;
      var type = document.getElementById("bookingType").value;
      var number = document.getElementById("numberOfPeople").value;
      
      //The addEvent can't be accessed, currently this function doesn't have access to the object Fullcalendar and because of that
      //we can't use addEvent.
        theCalendar.addEvent({
        title: eventName,
        start: sDate,
        allDay: true
      });
      alert('Great. Now, update your database...');

    }
  }

Hello, my vue.JS code at the moment cant read undefined properties. I want to be able to populate the addEvent class with my calendar properties.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

if you are trying to access the API

you should provide a ref on your calendar

<FullCalendar ref="fullCalendar" :options="calendarOptions" />

which can then be accessed as so

let calendarApi = this.$refs.fullCalendar.getApi()
calendarApi.next()

see here

however i suspect that you actually want is to access the calendarOptions object which is as simple as

this.calendarOptions.events

assuming you have defined the object as specified on the previous link

data() {
  return {
    calendarOptions: {
      plugins: [ dayGridPlugin, interactionPlugin ],
      events: [
        { title: 'event 1', date: '2019-04-01' },
        { title: 'event 2', date: '2019-04-02' }
      ]
    }
  }
},
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda