javascript - Using Cytoscape chart in Vue 2 component - how do I initialize chart only when container has rendered? -


i hope can explain without typing out bunch of code, don't have code hand right now.

i have created vue component supposed render cytoscape chart (but imagine same problem occurr charting or mapping library). component uses v-if render if has data render, component not built on page until handed data.

the component uses 'mounted' lifecycle hook initialize chart once component rendered. however, behaves if container has size of 0x0 , clusters of data in top-left corner. seems occur regardless of whether specify in css dimensions of container , if try explicitly set container dimensions using javascript before chart initializes.

is there event or hook can hook in vue 2 hold off on intializing chart until html content of template built , therefore has acessible properties, seems "mounted" not this?


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -