0.3.3 • Published 6 years ago
vue-weekly-schedule v0.3.3
vue-weekly-schedule
A simple component to show a repeating weekly schedule.
Install
npm install --save vue-weekly-scheduleUse as a plugin -
import Vue from 'vue';
import WeeklySchedule from 'vue-weekly-schedule';
Vue.use(WeeklySchedule); // Adds 'weekly-schedule' componentor directly use as a component
import WeeklySchedule from 'vue-weekly-schedule';
export default {
components: {
WeeklySchedule,
...
},
...
};Props -
| Prop | Description | Type | Default |
|---|---|---|---|
| schedules* | Array of schedules | Array | |
| eventClass | A class you want to attach to each event | String | '' |
| showEmptyDays | Toggle showing days which don't have any events to them | Boolean | false |
| showAddBtn | Toggle showing add button | Boolean | false |
| maxEvents | Toggle disabling add button after a max number of events is added | Number | 0 |
| showLegend | Show legend for the calendars | Boolean | false |
schedules expects the following format -
const schedules = [{
name: String,
class: String,
events: [
{
day: Number,
startTime: String, // 'HH:mm'
endTime: String, // 'HH:mm'
class: String,
},
],
}];The class is added to each event of the schedule.
Events -
| Event | Description | Payload |
|---|---|---|
| addBtnClick | Emitted when the + button is clicked | Number, day of add button that was clicked |
| eventClick | Emitted when an event is clicked | Object, event object for the clicked event |
Development setup
npm installCompiles and hot-reloads for development
npm run serveCompiles and minifies for production
npm run buildRun your tests
npm run testLints and fixes files
npm run lint