"TypeError: Cannot read property 'Network' of undefined" in vis-network
"TypeError: Cannot read property 'Network' of undefined" in vis-network
我正在尝试在 vueJS 2.6 中创建一个可视化网络
我的vis-network版本是8.3.2
我在 vis-network 中收到 TypeError: Cannot read 属性 'Network' of undefined"
以下是我的代码
<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>
通过替换导入语句解决了它
import {Network } from 'vis-network/standalone/umd/vis-network.min'
我正在尝试在 vueJS 2.6 中创建一个可视化网络 我的vis-network版本是8.3.2 我在 vis-network 中收到 TypeError: Cannot read 属性 'Network' of undefined" 以下是我的代码
<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>
通过替换导入语句解决了它
import {Network } from 'vis-network/standalone/umd/vis-network.min'