【问题标题】:Vuetify Call a function of a component from another oneVuetify 从另一个组件调用一个组件的功能
【发布时间】:2019-07-26 07:24:42
【问题描述】:

我想从另一个组件调用 v-calendar (next 和 prev) 的函数。
我已经尝试使用 refs,它可以从 v 日历的同一组件调用 next 和 prev,
但从祖父母组件它不起作用。

子组件

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

祖父组件

<template>
  <v-btn @click="$refs.calendar.next()">
    <v-icon>
      keyboard_arrow_right
    </v-icon>
  </v-btn>
</template>

【问题讨论】:

标签: vue.js calendar vuetify.js


【解决方案1】:

最后我使用了 Vuex 来管理 v-calendar 的“开始”

【讨论】:

    猜你喜欢
    • 2017-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-14
    相关资源
    最近更新 更多