[Vuejs]-How to get in script tag of vue file of / pages / when using Nuxt.js and nuxt-i18n

3👍

You have access to the nuxt-i18n translation helper in the script of your page with this.$t and the head method on the other hand has access to the this context.
So you could do something like this:

export default {
    head () {
        return {
            title: this.$t('HELLO_WORLD')
        }
    }
}
👤micbra

0👍

Use the head method to set the HTML Head tags for the current page.

https://nuxtjs.org/api/pages-head/

Leave a comment