1.0.4 • Published 5 years ago
vue-resource-timeline v1.0.4
vue-resource-timeline
A simple component to show timeline of events categorized by resources.
Install
npm install --save vue-resource-timelineUse as a plugin -
import Vue from 'vue';
import ResourceTimeline from 'vue-resource-timeline';
Vue.use(ResourceTimeline); // Adds 'resource-timeline' componentor directly use as a component
import ResourceTimeline from 'vue-resource-timeline';
export default {
components: {
ResourceTimeline,
...
},
...
};Props -
| Prop | Description | Type | Default |
|---|---|---|---|
| resources* | Array of resources | Array | |
| events* | Array of events | Array | |
| showEmptyResource | Toggle showing of resources with no events | Boolean | false |
| showAddBtn | Toggle showing add button | Boolean | false |
events expects the following format -
const events = [{
resourceId: String/Number, // Strictly matches the value of a resource.id
start: String, // 'HH:mm'
end: String, // 'HH:mm'
class: String, // Optional
title: String, // Optional
}];resources expects the following format -
const resources = [{
id: String/Number, // Strictly matches the value of a resource.id
class: String, // Optional
title: String, // Optional
}];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, original 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