While constructing a timeline in my vue.js
application, I opted to utilize vis.js
. Unfortunately, I encountered some issues when attempting to incorporate events. Initially, setting @drop="myDropCallback()"
did not trigger the function upon dropping an item. Surprisingly, replacing it with @mouseOver="myDropCallback()"
resolved the issue, which is quite peculiar.
Moreover, during the mouseOver
event, my intention was to retrieve the event properties using
this.$refs.timeline.getEventProperties(event)
, but this consistently resulted in the following error:
Error in event handler for "click": "TypeError: Cannot read property 'center' of undefined"
Additionally, I kept encountering this error message:
Cannot read property 'center' of undefined
I am seeking assistance in resolving these errors. Is there a solution available, or could I be overlooking something?
Template
<timeline v-if="items.length > 0" ref="timeline"
:items="items"
:groups="groups"
:options="options"
@drop="myDropCallback()">
</timeline>
Drop function
myDropCallback: function (event) {
console.log('value', this.$refs.timeline.getEventProperties())
},
Snapshot of the timeline