Open MTHLily opened 3 years ago
thank you for your share:)
I'm currently making an application using Vue.js and Marzipano.
At first, everything seems straightforward. I'm storing the viewer and the scenes as objects inside my data(). But then, when I try to implement hotspots, it's not rendered. No error messages on the console, nothing.
I checked the document tree: the hotspot element is there. If I get rid of a display: none somewhere, I can see it and when I move around, the hotspot moves along fine. It just doesn't render at first.
I try a lot of things, and after a few hours, I did find the thing that did fix it: instead of storing the Viewer as part of the data of the Vue component, I stored it as a regular variable.
Maybe because it wasn't a Proxy object, but this seemed to fix the problem.
Maybe it's because of the virtual DOM thing, but I did create a Viewer with an element both in the virtual DOM and in the actual html file itself, and both worked when it was stored as a regular variable, and broke when it was stored as Vue.js data.
Hey, I have also done the same and mine is working.
The main component initializes viewer in mounted hook and i save the viewer in this.viewer
to use it later.
I'm currently making an application using Vue.js and Marzipano.
At first, everything seems straightforward. I'm storing the viewer and the scenes as objects inside my data(). But then, when I try to implement hotspots, it's not rendered. No error messages on the console, nothing.
I checked the document tree: the hotspot element is there. If I get rid of a display: none somewhere, I can see it and when I move around, the hotspot moves along fine. It just doesn't render at first.
I try a lot of things, and after a few hours, I did find the thing that did fix it: instead of storing the Viewer as part of the data of the Vue component, I stored it as a regular variable.
Maybe because it wasn't a Proxy object, but this seemed to fix the problem.
Maybe it's because of the virtual DOM thing, but I did create a Viewer with an element both in the virtual DOM and in the actual html file itself, and both worked when it was stored as a regular variable, and broke when it was stored as Vue.js data.