我正在尝试在vueJS 2.6中创建可见网络 我的网络版本是8.3.2 我收到TypeError:无法在可视网络中读取未定义的属性“网络” 以下是我的代码
<div id="mynetwork"></div>
</template>
<script>
import vis from 'vis-network'
export default {
data() {
return {
network: null,
nodes: [
{ id: 1, shape: "circularImage"},
{ id: 2, shape: "circularImage"},
],
edges: [
{ from: 1, to: 2 },
],
options: {
},
},
container: "",
};
},
mounted() {
this.container = document.getElementById("mynetwork");
var data = {
nodes: this.nodes,
edges: this.edges,
};
this.network = new vis.Network(this.container, data, this.options);
},
};
</script>
答案 0 :(得分:0)
通过替换导入语句来解决
import {Network } from 'vis-network/standalone/umd/vis-network.min'