<template>
  <div id="app">
    <vue-functional-calendar
      @change-month="handleMonthChange"
      @change-year="handleYearChange"
    />
  </div>
</template>
 
<script>
import VueFunctionalCalendar from 'vue-functional-calendar';
 
export default {
  components: {
    VueFunctionalCalendar
  },
  methods: {
    handleMonthChange(month, year) {
      // 处理月份变化
      console.log('New month:', month, 'New year:', year);
    },
    handleYearChange(year) {
      // 处理年份变化
      console.log('New year:', year);
    }
  }
};
</script>这个例子展示了如何在Vue应用中使用vue-functional-calendar组件,并且如何通过@change-month和@change-year事件处理器来响应日历视图中的月份和年份变化。这个例子简洁明了,并且提供了一个实际的用例,对于想要在自己的Vue项目中集成日历功能的开发者来说,这是一个很好的学习资源。