2

First of all, I am a solid newbie on vuejs, so please keep that in mind :)

I am using vue-router for my single page application, and whenever I do a router.push or router.link to change the routes it takes about 5-6 seconds on mobile, in desktop it takes about 1-2 seconds

 onSearchInput(service) {
                if (this.search === '') {
                    return;
                }
                this.$store.commit(mutationTypes.UPDATE_SEARCH, service);
                this.$router.push('/list');
            },

This is one of my use-cases where, whenever something is entered on an input box a $router.push is called, pretty simple, but this takes about 5-6 seconds (sometimes more) in mobile, in desktop takes 1-2 seconds to change the route.

I am wondering if there are some ways to decrease the time it takes to change the route. I am using vue 2.5.2

Dhiraj
  • 2,687
  • 2
  • 10
  • 34
  • It could be many possible reasons and there doesn't seem to be enough context to answer the question. I would recommend breaking it down and test the router by itself, is there a delay if you change route on `@click` instead? Is the 1-2 delay on desktop intended? Are there any errors in the console? – mika Jun 07 '18 at 15:12
  • @mika I tried `@click` and it's the same delay. 1-2 delay on desktop is not intended, I want it to be instant without any delay (if possible) – Dhiraj Jun 07 '18 at 15:15
  • Try looking inside App.vue to see if it s caused by a broken transition https://stackoverflow.com/questions/41221099/vue-js-page-transition-fade-effect-with-vue-router – mika Jun 07 '18 at 15:20
  • @mika There are no transitions used. – Dhiraj Jun 07 '18 at 17:56
  • This is hard to say without much more info, i would suggest you recreate the issue in a jsFiddle – mika Jun 07 '18 at 20:10

0 Answers0