#nuxt.js #share-open-graph #open-graph-beta #nuxt-content
Вопрос:
Открытый график не отображается при совместном использовании ссылки, она отображается по умолчанию или пуста.. Я хочу установить его как динамический для каждой страницы.
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',
},
],
}
},