R
R
Redrik_Shuhart2019-09-07 00:41:08
Vue.js
Redrik_Shuhart, 2019-09-07 00:41:08

How to get the title from the component in NUXT?

How to correctly find out the title in the component after changing the route?
I have a pageTitle computed property in my component that I'm trying to evaluate like this:

computed: {
    pageTitle(){
        if (process.client) {
          return this.$parent.$metaInfo.title
        }
        else{
          return ''
        }
      }
    }

But it works every other time, sometimes when changing the route, an error occurs that the title is undefined

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question