0.0.54 • Published 5 years ago
vuejs-editable-timeline-vuejs v0.0.54
📦 Install
npm install timeline-vuejs --save
// main.js
import '../node_modules/timeline-vuejs/dist/timeline-vuejs.css'
// component.vue
<script>
import Timeline from 'timeline-vuejs'
export default {
// ...
components: {
Timeline
}
// ...
}
</script>
🔧 Usage
<template>
<Timeline
:timeline-items="timelineItems"
:message-when-no-items="messageWhenNoItems"/>
</template>
<script>
import Timeline from 'timeline-vuejs'
export default {
components: {
Timeline
}
data: () => ({
messageWhenNoItems: 'There are not items',
timelineItems: [
{
from: new Date(2018, 7),
title: 'Name',
description:
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Eius earum architecto dolor, vitae magnam voluptate accusantium assumenda numquam error mollitia, officia facere consequuntur reprehenderit cum voluptates, ea tempore beatae unde.'
},
{
from: new Date(2016, 1),
title: 'Name',
description:
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Eius earum architecto dolor, vitae magnam voluptate accusantium assumenda numquam error mollitia, officia facere consequuntur reprehenderit cum voluptates, ea tempore beatae unde.'
},
{
from: new Date(2016, 6),
title: 'Name',
description:
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Eius earum architecto dolor, vitae magnam voluptate accusantium assumenda numquam error mollitia, officia facere consequuntur reprehenderit cum voluptates, ea tempore beatae unde.'
},
{
from: new Date(2012, 1),
title: 'Name',
description:
'Lorem ipsum dolor sit amet consectetur adipisicing elit. Eius earum architecto dolor, vitae magnam voluptate accusantium assumenda numquam error mollitia, officia facere consequuntur reprehenderit cum voluptates, ea tempore beatae unde.'
}
]
})
}
</script>
Available props
Example with order
<template>
<Timeline
:timeline-items="timelineItems"
:message-when-no-items="messageWhenNoItems"
order="desc"/>
</template>
...
Example with unique year
<template>
<Timeline
:timeline-items="timelineItems"
:message-when-no-items="messageWhenNoItems"
:unique-year="true"
order="asc"/>
</template>
...
Example with day and month on title
If you want to show day and month on specific items, send true on prop showDayAndMonth
<script>
export default {
data: () => ({
timelineItems: [
{
from: new Date(2017, 5, 2),
title: 'Name',
description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
showDayAndMonth: true
},
{
from: new Date(2017, 8, 9),
title: 'Name',
description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.'
}
]
})
}
</script>
Example with diferent colors
<script>
export default {
data: () => ({
timelineItems: [
{
from: new Date(2017, 5, 2),
title: 'Name',
description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
color: '#e74c3c'
},
{
from: new Date(2017, 8, 9),
title: 'Name',
description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit.',
color: '#2ecc71',
}
]
})
}
</script>
0.0.54
5 years ago
0.0.51
5 years ago
0.0.52
5 years ago
0.0.53
5 years ago
0.0.50
5 years ago
0.0.49
5 years ago
0.0.41
5 years ago
0.0.42
5 years ago
0.0.43
5 years ago
0.0.44
5 years ago
0.0.45
5 years ago
0.0.46
5 years ago
0.0.47
5 years ago
0.0.48
5 years ago
0.0.40
5 years ago
0.0.39
5 years ago
0.0.38
5 years ago
0.0.37
5 years ago
0.0.36
5 years ago
0.0.35
5 years ago
0.0.30
5 years ago
0.0.31
5 years ago
0.0.32
5 years ago
0.0.33
5 years ago
0.0.34
5 years ago
0.0.26
5 years ago
0.0.27
5 years ago
0.0.28
5 years ago
0.0.29
5 years ago
0.0.25
5 years ago
0.0.20
5 years ago
0.0.21
5 years ago
0.0.22
5 years ago
0.0.23
5 years ago
0.0.24
5 years ago
0.0.16
5 years ago
0.0.17
5 years ago
0.0.18
5 years ago
0.0.19
5 years ago
0.0.13
5 years ago
0.0.14
5 years ago
0.0.15
5 years ago
0.0.12
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.2
5 years ago
0.0.1
5 years ago