[READ-ONLY] Mirror of https://github.com/danielroe/generate-payload.
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: add example of asyncdata/head interaction

Daniel Roe (Nov 30, 2020, 9:10 PM UTC) f47d2d7e 9fc65561

+20 -5
+10
nuxt.config.js
··· 1 1 export default { 2 2 target: 'static', 3 + generate: { 4 + async routes() { 5 + return [{ 6 + route: '/', 7 + payload: { 8 + name: 'wibble' 9 + } 10 + }] 11 + } 12 + } 3 13 }
+10 -5
pages/index.vue
··· 6 6 7 7 <script> 8 8 export default { 9 + head() { 10 + return { 11 + title: this.test 12 + } 13 + }, 14 + async asyncData({ payload }) { 15 + return { 16 + test: payload.name 17 + } 18 + }, 9 19 data: () => ({ 10 20 test: 0 11 21 }), 12 - fetch() { 13 - console.log("fetching now"); 14 - this.test = 24; 15 - }, 16 - fetchOnServer: false 17 22 }; 18 23 </script>