Skip to content

Commit

Permalink
0.1.6 add click handler
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdv committed Jan 12, 2022
1 parent c6da993 commit 439901e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
12 changes: 9 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
<title>vue-timeline-component demo</title>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/[email protected].5"></script>
<script src="https://unpkg.com/[email protected].6"></script>
<style>
body {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
Expand All @@ -14,7 +14,7 @@
<body>
<h3>vue-timeline-component demo</h3>
<div id="app">
<demo :data="events"></demo>
<demo :data="events" :config="config"></demo>
</div>

<script>
Expand All @@ -36,7 +36,13 @@ <h3>vue-timeline-component demo</h3>
name: "event 3",
start: new Date(2020, 1,3),
end: new Date(2020, 1,10),
}]
}],
config: {
onEventClick(event) {
console.log('global click')
console.log(event)
}
}
}
}
}).$mount('#app')
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-timeline-component",
"version": "0.1.5",
"version": "0.1.6",
"main": "dist/vue-timeline-component.umd.js",
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
6 changes: 5 additions & 1 deletion src/components/VueTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export default {
props: {
data: {
type: Array
},
config: {
type: Object,
default: () => {}
}
},
mounted() {
Expand All @@ -25,7 +29,7 @@ export default {
left: 15,
right: 15
},
//onEventClick: click
onEventClick: this.config?.onEventClick
}))
}
}
Expand Down

0 comments on commit 439901e

Please sign in to comment.