Vue-meta: work with router meta

Created on 9 Nov 2017  路  2Comments  路  Source: nuxt/vue-meta

Maybe this was dicussed before but I couldnt find it, but is there a way I can set the titles i want in routes meta, and then get it to vue-meta? Working together with titleTemplate aswell, I'm trying to do with beforeEach router hooks but didn't realized yet

Most helpful comment

If someone still needing this

const routes = [
  {
    path: '/some-path',
    name: 'some-name',
    component: SomeComponent,

    meta: {
      title: 'Some cool title'
    }
  }
]
metaInfo() {
  return {
    title: this.$route.meta.title
  }
}

All 2 comments

It should work within Component beforeEach hook directly, I don't have time to give you an example sorry.

If someone still needing this

const routes = [
  {
    path: '/some-path',
    name: 'some-name',
    component: SomeComponent,

    meta: {
      title: 'Some cool title'
    }
  }
]
metaInfo() {
  return {
    title: this.$route.meta.title
  }
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

iMomen picture iMomen  路  5Comments

nathanchase picture nathanchase  路  3Comments

dystopiandev picture dystopiandev  路  6Comments

diff-dennis picture diff-dennis  路  8Comments

terazus picture terazus  路  8Comments