Answer the question
In order to leave comments, you need to log in
How to make ref point to a component?
Trying to integrate vis-network with Vue. I am using the plugin https://github.com/r3code/vue-vis-network . An error pops up: "Cannot read property 'hasChildNodes' of undefined". I have a suspicion that the plugin is not looking for data in the data section of the component, but is trying to access #app. How can this be fixed?
Component code:
<template>
<el-container >
<el-main>
<network ref="network" :nodes="nodes" :edges="edges" :options="options"> </network>
<button @click="get_data">GetData</button>
</el-main>
</el-container>
</template>
<script>
export default {
components: { Notification },
data () {
return {
nodes: [],
edges: [],
options: []
}
},
methods:
{
get_data()
{
axios.get(base_url + '/graph')
.then((response) => {
this.nodes = response.data.nodes;
this.edges = response.data.edges;
}).catch((error) => {
console.log(error);
});
}
},
}
</script>
Vue.component('network', new vueVisNetwork.Network);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question