Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling `this.$route causes huge flickering #320

Closed
antoinerey opened this issue Feb 12, 2019 · 2 comments
Closed

Calling `this.$route causes huge flickering #320

antoinerey opened this issue Feb 12, 2019 · 2 comments

Comments

@antoinerey
Copy link

Note that this issue was originaly created in nuxt/nuxt#4945.

Reproduction link

https://codesandbox.io/s/14qm9krom7

Steps to reproduce

  1. Navigate back and forth between the home and about pages. Everything works properly, and there is no flickering at all.
  2. Open the layouts/default.vue file, uncomment console.log(this.$route).
  3. Navigate again between the home and about pages. When leaving the home page (using the default layout under the hood), a big flickering happens.

Note that the exact opposite happens when adding console.log(this.$route) in layouts/random.vue instead.

What is expected ?

No flickering at all.

What is actually happening?

Some huge flickering.

Additional comments?

For some reason, I need to disable a JS script based on a query parameter. Accessing / should load the script, but accessing /?script=false should prevent the script to load. So, I needed to access this.$route, and ran into this bug.

@pimlie
Copy link
Collaborator

pimlie commented Feb 20, 2019

As mentioned in my comment in the linked Nuxt issue, we should have more control for throttling updates for issues like this.
Also I think we should treat page navigation (with vue-router) as a special case and add navigation guards to only update the head once after navigation has finished

pimlie added a commit to pimlie/vue-meta that referenced this issue Feb 20, 2019
…uxt#320)

chore: add es build

chore: global window detection

chore: small refactor improvements
@pimlie
Copy link
Collaborator

pimlie commented Apr 20, 2019

Closing as changes for this issue are included in the v2 release candidate. Please help us testing the release candidate and report any follow-ups in a new issue

@pimlie pimlie closed this as completed Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants