2

I'd like to call a function of v-calendar (next and prev) from another component.
I have tried with refs, it work to call next and prev from the same component of the v-calendar,
but from a grandparent component it doesn't work.

Child component

<template>
   <v-calendar
     ref="calendar"
     ...
   ></calendar>
</template>

Grandparent component

<template>
  <v-btn @click="$refs.calendar.next()">
    <v-icon>
      keyboard_arrow_right
    </v-icon>
  </v-btn>
</template>
Olivier.B
  • 91
  • 2
  • 9
  • 1
    I would check out this question: https://stackoverflow.com/questions/49676654/vue-access-nested-childs-using-ref – Adam Mar 05 '19 at 02:39

1 Answers1

1

Finally i have used Vuex to manage the "start" of the v-calendar

Olivier.B
  • 91
  • 2
  • 9