Vue-meta: Add locale to title meta

Created on 29 Oct 2017  路  5Comments  路  Source: nuxt/vue-meta

Is it available to include a local string to the title meta?
my data object is something like this
pageTitle: 'Loading... | $t("websiteName")',

Most helpful comment

@akaneru Instead of defining metaInfo as an object, define it as a function and access this as usual.

export default { metaInfo () { return { title: this.$t("home.title"), } } }

vue-meta FAQ

All 5 comments

Any update about that? I would need to this functionality. It would fantastic if it will possible.
Working on it by my self I don't have found a solution.

Thank you!

It should work by using metaInfo as a function directly.

See i18n example with Nuxt.js: https://github.com/nuxt/nuxt.js/blob/dev/examples/i18n/pages/_lang/index.vue#L13

Thank you for the reply, I've tried like specified in the example but for me still not working!
Best regards

@akaneru Instead of defining metaInfo as an object, define it as a function and access this as usual.

export default { metaInfo () { return { title: this.$t("home.title"), } } }

vue-meta FAQ

I confirm that your solution works!
Thank you :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

terazus picture terazus  路  8Comments

xrei picture xrei  路  10Comments

derz picture derz  路  3Comments

diff-dennis picture diff-dennis  路  8Comments

vishr picture vishr  路  5Comments