mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-23 16:13:50 +00:00
visgraph: init window.eventHub as external emitter called in Vue. This implementation works with vue2, but is deprecated in vue3 !!
see https://vue3-fr.netlify.app/guide/migration/events-api.html#_2-x-syntax
This commit is contained in:
@@ -79,6 +79,12 @@ export default {
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
eventHub.$on('add-switch', this.addSwitch)
|
||||
},
|
||||
unmounted() {
|
||||
eventHub.$off('add-switch', this.addSwitch)
|
||||
},
|
||||
mounted() {
|
||||
console.log('=== mounted: init graph')
|
||||
this.initGraph()
|
||||
@@ -118,6 +124,9 @@ export default {
|
||||
console.log('** click on node **')
|
||||
window.network.on('click', callback)
|
||||
},
|
||||
addSwitch(edgeData) {
|
||||
console.log('==> addSwitch <=======================', edgeData)
|
||||
},
|
||||
}
|
||||
/*
|
||||
TODO / TO CHECK / TO UNDERSTAND
|
||||
|
Reference in New Issue
Block a user