In the blog application for my project using Nuxt JS 2.4.5, I am utilizing Vue Meta.
I'm encountering difficulties while attempting to set the title along with a variable from data ()
, and it seems like something crucial is eluding me.
Despite trying various methods like rearranging code, setting it manually with this
, nothing seems to be effective...
<script>
import BlogsFromJson from '~/static/articles/blogs.json';
export default {
head: {
title: 'My Website: Blog: ' + this.myBlogTitle, // or something else
meta: [
{ hid: 'description', name: 'description', content: 'Read the latest news and articles from Flex Repay UK.' }
]
},
data () {
return {
title: this.$route.params.title,
blog: BlogsFromJson,
myBlogTitle: 'some title'
}
}
}
</script>
Even after attempting to define a variable within data ()
and employing it statically.
This setup should ideally provide me with My Website: Blog: some title
What could possibly be missing in this scenario?