[Vuejs]-VueJS show splash screen after login (different landing page)

0👍

As a followup on my comment: you can mount a separate Vue instance. You can do it with something like this:

createNewInstance: function(){
    const splash = new Vue({
    methods: {
      closeHandler() {
        return function() {
          splash.$destroy();
          splash.$el.remove();
        };
      }
    },
    render(h) {
      return h(YourSplashComponent, {
        mounted() {
          setTimeout(this.closeHandler(), 3000)
        }
      });
    }
  }).$mount();
  document.body.appendChild(splash.$el);
}

Just be sure to import and create a component on where YourSplashComponent is stated in the example.
Call the function right before you do trigger your route

0👍

If you have 9 different routes a user can be directed to, could you:

  • create a modal component
  • load it into these views/routes
  • open it when the route is mounted

This way the modal code is centralized in its own component, and can watch for a property change to appear.

Leave a comment