In nuxt.config.js:
module.exports = {
mode: 'spa',
head: {
title: 'Generic title',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Generic description' }
]
}
/*
** other things
*/
}
In one of the pages (/pages/b.vue):
<script>
export default {
head () {
return {
title: 'Page B',
meta: [
{ hid: 'description', name: 'description', content: 'Page B description' }
]
}
}
}
</script>
Then "nuxt generate"
Go to /dist/b/index.html
Expect to see:
<meta data-n-head="true" content="Page B description" name="description" data-hid="description">
and
<title data-n-head="true">Page B</title>
but get:
<meta data-n-head="true" content="Generic description" name="description" data-hid="description">
and
<title data-n-head="true">Generic title</title>
Related to: https://nuxtjs.org/api/pages-head/
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2010">#c2010</a>)</em></sub></div>