vue2-simple-calendar

A simple event calendar component
2,776 53
Install
npm install vue2-simple-calendar
Latest Version:1.0.8
Vue:2
License:MIT
Last Updated:Sep 9, 2020
Links: GitHub  ·  npm
Maintainer: vincent_trekels

vue2-calendar

npm npm

Check out the demo here on Code Sandbox: Edit Vue Template

Introduction

This is a simple and small event calendar component for Vue js. It is very lightweight and does not depend on external libraries apart from Vue2 obviously.

Table of contents

Installation

Add the package to your project.

 npm install vue2-simple-calendar
 
 yarn add vue2-simple-calendar

require or import the component in your project index file (or where you instantiate Vue) and install as shown below. You can add a configuration object to tweak the calendar to your needs but it is not required.

import vueCalendar from 'vue2-simple-calendar';

Vue.use(vueCalendar, {
  // configuration goes here.
});

Now all is in place to use the component.

Usage

The component is used like shown below. Page specific config and data is passed trough properties, the app level config like locale ,firstDay ,... can be configured on initialization trough the config object. All events can be bound to the parent but are available through the complete application trough an event bus.

<template>
  <vue-calendar
      :show-limit="3"
      :events="events"
      :disable="disabledDays"
      :highlight="highlightDays"

      @show-all="showAll"
      @day-clicked="dayClicked"
      @event-clicked="eventClicked"
      @month-changed="monthChanged"
  ></vue-calendar>
</template>

<script>
  export default {
    name: 'your-component',
    methods: {
      showAll(events) {
        // Do something...
      },
      dayClicked(day) {
        // Do something...
      },
      eventClicked(event) {
        // Do something...
      },
      monthChanged(start, end) {
        // Do something...
      }
    },
    created() {
      this.$calendar.eventBus.$on('show-all', events => showAll(events));
      this.$calendar.eventBus.$on('day-clicked', day =>  dayClicked(day));
      this.$calendar.eventBus.$on('event-clicked', event => eventClicked(event));
      this.$calendar.eventBus.$on('month-changed', (start, end) => monthChanged(start, end));
    }
  }
</script>

Related Packages

vue-button-spinner

A simple button spinner.

16,948 35
@enso-ui/calendar

Calendar page modules and event-management components for Enso UI.

8,197 0
vue-mobile-calendar

a vue component of calendar for mobile Vue移动端日期选择控件

5,490 210
vue2-event-calendar

A vue2 calendar component, have week and month two mode, custom render event

5,382 74
ele-calendar

A Vue.js calendar

3,361

Version History

Version Released Vue License
1.0.8 ^2.4.2 MIT
1.0.7 ^2.4.2 MIT
1.0.6 ^2.4.2 MIT
1.0.5 ^2.5.13 MIT
0.0.19 ^2.4.2 MIT