Skip to content

(v2) error when using this.$route in metaInfo #348

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

Closed
pimlie opened this issue Apr 20, 2019 · 0 comments
Closed

(v2) error when using this.$route in metaInfo #348

pimlie opened this issue Apr 20, 2019 · 0 comments
Assignees

Comments

@pimlie
Copy link
Collaborator

pimlie commented Apr 20, 2019

The first time metaInfo is called it seems this.$route has not yet been set.

Failing code:

export default {
  ...
  metaInfo() {
    return {
      meta: [
        { hid: 'og-url', property: 'og:url', content: 'https://example.com' + this.$route.fullPath }
      ],
  }
}
@pimlie pimlie self-assigned this Apr 20, 2019
@pimlie pimlie closed this as completed in e80643b Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant