Nuxt设置页面的title,keywords,description.
head函数内部可以直接使用this来获取组件实例对象,以便来获取data的值。
export default {
head(){
return {
title: this.detail.title + '--互联网舆情监测系统-全网络信息舆情监控分析软件平台',
meta: [
{
hid: 'description',
name: 'description',
content: this.detail.desc
},{
hid: 'keywords',
name: 'keywords',
content: this.detail.keywords
}
]
}
},
}