fullcalendar.js 521 B

12345678910111213141516171819202122
  1. import FullCalendar from "../../static/utils/index.global.min.js";
  2. export default {
  3. template: "<div></div>",
  4. props: {
  5. options: Array,
  6. },
  7. mounted() {
  8. this.options.eventClick = (info) => this.$emit("click", { info });
  9. this.calendar = new FullCalendar.Calendar(this.$el, this.options);
  10. this.calendar.render();
  11. },
  12. methods: {
  13. update_calendar() {
  14. if (this.calendar) {
  15. this.calendar.setOption("events", this.options.events);
  16. this.calendar.render();
  17. }
  18. },
  19. },
  20. };