Update to use nuxt generate

This commit is contained in:
Sebastien Chopin 2017-08-03 10:47:19 +02:00
parent 7a103e0e95
commit 821f001e73
3 changed files with 12 additions and 1 deletions

View File

@ -6,5 +6,13 @@ module.exports = {
color: '#4FC08D', color: '#4FC08D',
failedColor: '#bf5050', failedColor: '#bf5050',
duration: 1500 duration: 1500
},
head: {
title: 'Default title'
},
generate: {
routes: [
'/posts/1',
]
} }
} }

View File

@ -10,7 +10,7 @@
<script> <script>
export default { export default {
asyncData: ({ req }) => ({ asyncData: ({ req }) => ({
userAgent: (req ? req.headers['user-agent'] : navigator.userAgent) userAgent: (req ? req.headers['user-agent'] : (typeof navigator !== 'undefined' ? navigator.userAgent : 'No user agent (generated)'))
}) })
} }
</script> </script>

View File

@ -21,6 +21,9 @@ export default {
.then((res) => { .then((res) => {
return { posts: res.data.slice(0, 5) } return { posts: res.data.slice(0, 5) }
}) })
},
head: {
title: 'List of posts'
} }
} }
</script> </script>