tiny-emitter package is used as "centralized event hub" between vis-network and vue3

This commit is contained in:
2021-11-01 11:46:30 +01:00
parent a0940a0c85
commit 41f815bbb9
2 changed files with 9 additions and 11 deletions

View File

@@ -80,10 +80,10 @@ export default {
},
created() {
eventHub.$on('add-switch', this.addSwitch)
eventHub.on('add-relationship-link', this.addRelationshipLink)
},
unmounted() {
eventHub.$off('add-switch', this.addSwitch)
eventHub.off('add-relationship-link', this.addRelationshipLink)
},
mounted() {
console.log('=== mounted: init graph')
@@ -124,8 +124,8 @@ export default {
console.log('** click on node **')
window.network.on('click', callback)
},
addSwitch(edgeData) {
console.log('==> addSwitch <=======================', edgeData)
addRelationshipLink(edgeData) {
console.log('==> addRelationshipLink <=======================', edgeData)
},
}
/*