共享链接时未显示打开的图形,它显示默认或空白。我想将其设置为每个页面的动态。
async asyncData({ route, app }) {
const appData = await 'my API call for data'
if (appData) {
return {
pageTitle: appData.title,
pageThumbnail: appData.thumbnail,
}
}
},
这是我head
设置打开图形数据的部分
head() {
const title = this.pageTitle + ' | SiteNAme'
return {
title,
meta: [
{
hid: 'description',
name: 'description',
content: 'des...',
},
{
hid: 'og:type',
name: 'og:type',
content: 'website',
},
{
hid: 'og:title',
name: 'og:title',
content: title,
},
{
hid: 'og:description',
property: 'og:description',
content: 'des...',
},
{
hid: 'og:image',
property: 'og:image',
content: this.pageThumbnail ? this.pageThumbnail : '/local iage path',
},
],
}
},