0
I was trying to create a Timeline using Vis.js, using Vuejs 2 Adapter for Visjs,(https://github.com/alexcode/vue2vis) and the following error occurred :.
It must be an import error.If anyone can help, follow the code:
import vue2vis from 'vue2vis';
import Vue from 'vue'
Vue.component('timeline', vue2vis.Timeline);
const ItemComponent = Vue.extend({
template: '<p>{{item.content}}</p>',
props: ['item'],
});
export default {
data(){
return {
groups: [{
id: 0,
content: 'Group 1'
}],
items: [{
id: 0,
group: 0,
start: new Date(),
content: 'Item 1'
}],
options: {
editable: true,
template: (item) => {
return new ItemComponent({
store: this.$store,
parent: this,
propsData: {
item,
},
}).$mount().$el;
}
}
}
},
}
<div id="visualization" ref="myDiv">
<timeline ref="timeline" :items="items" :groups="groups" :options="options">
</div>
</div>
From now on I thank you for your help!
Have you tried closing the <Timeline> component tag? or importing Vue before vue2vis ?
– Felipe Duarte