頁面的meta對于seo的設(shè)置非常重要,默認(rèn)的配置在nuxt.config.js 剩岳,不同的頁面一般都有不同的title和meta設(shè)置贞滨,個(gè)性化配置再去每個(gè)頁面直接加入head() 方法。
head () {
return {
title: this.title,
meta: [
{ hid: 'description', name: 'description', content:this.content }
]
}
}
E淖亍O勺良!注意:為了避免子組件中的meta標(biāo)簽不能正確覆蓋父組件中相同的標(biāo)簽而產(chǎn)生重復(fù)的現(xiàn)象,建議利用 hid 鍵為meta標(biāo)簽配一個(gè)唯一的標(biāo)識(shí)編號(hào)骄噪。
相關(guān)配置詳細(xì):
https://zh.nuxtjs.org/guide/views#html-%E5%A4%B4%E9%83%A8
https://zh.nuxtjs.org/api/pages-head/
https://zh.nuxtjs.org/faq/duplicated-meta-tags
https://github.com/declandewet/vue-meta#lists-of-tags