We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

UnloadScene in Vue.js

Home Forums Programming UnloadScene in Vue.js

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38443
    David Duperron
    Customer

    Hi,
    I am working on the integration of Verge3D content in a Quasar environment (based on Vue.js), and I am facing an issue.
    It seems that whenever I reload a page where I have a Verge3D scene loaded, it creates a new instance of everything, and that for example a function that is triggered when I hover an object is triggered once the first time the scene is loaded, twice the second time, 3 times the third, etc…
    Is there a way to “kill” the scene and everything attached to it (script, etc…) when the vue is destroyed, for example by adding something in the beforeDestroy section of the Vue file export_default??
    Thanks for your help!

    David

    #38450
    David Duperron
    Customer

    I think I found a solution myself…
    I simply removed the listener associated to the scene by adding the following:

      beforeDestroy: function () {
        eventBus.$off();
      },
    

    It seems to work fine!

    #38452

    Hi David! Glad you worked it out! :good:

    Chief 3D Verger | LinkedIn | Twitter

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.