Skip to content

i-platonov/vue-event-calendar

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-event-calendar

A simple events calendar for Vue2, no dependencies except Vue2. responsive & mobile first. Live Demo Here

npm version

Requirements

  • vue: ^2.0.0

Usage

install

 npm install vue-event-calendar --save

main.js

import vueEventCalendar from 'vue-event-calendar'
Vue.use(vueEventCalendar, {locale: 'en'}) //locale can be 'zh' or 'en'

file.vue

<template>
  <vue-event-calendar :events="demoEvents"></vue-event-calendar>
</template>

<script>
export default {
  data () {
    return {
      demoEvents: [{
        date: '2016/12/15',
        title: 'eat',
        desc: 'longlonglong description'
      },{
        date: '2016/11/12',
        title: 'this is a title'
      }]
    }
  }
}
</script>

Customization

If you want customization event template. required Vue: ^2.1.0. Because I use new feature(Scoped Slots) of ^2.1.0

Customization color

//When Vue.use, you can give a color
Vue.use(vueEventCalendar, {locale: 'en', color: '#4fc08d'})

Customization event template

<template>
  <vue-event-calendar :events="demoEvents">
      <template scope="props">
        <div v-for="(event, index) in props.showEvents" class="event-item">
          <!-- In here do whatever you want, make you owner event template -->
          {{event}}
        </div>
      </template>
    </vue-event-calendar>
</template>

<script>
export default {
  data () {
    return {
      demoEvents: [{
        date: '2016/12/15',
        title: 'eat',
        desc: 'longlonglong description'
      },{
        date: '2016/11/12',
        title: 'this is a title'
      }]
    }
  }
}
</script>

API

// NextMonth
this.$EventCalendar.nextMonth()
// PreMonth
this.$EventCalendar.preMonth()
//ToDate
this.$EventCalendar.toDate('2016/11/12')

More in Demo Folder

Develop

npm run dev  //develop
npm run build //production

About

A simple events calendar for Vue2, no dependencies except Vue2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 67.1%
  • JavaScript 30.5%
  • HTML 2.4%