1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| export default { async asyncData({ params, $axios }) { const detail = await $axios.$get(`/api/detail/${params.id}`) return { detail } }, head() { return { title: this.detail.title, meta: [ { hid: 'description', name: 'description', content: this.detail.description }, { hid: 'keywords', name: 'keywords', content: this.detail.keywords }, { hid: 'og:title', property: 'og:title', content: this.detail.title }, { hid: 'og:description', property: 'og:description', content: this.detail.description }, { hid: 'og:image', property: 'og:image', content: this.detail.image } ] } } }
|