mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
Update to use nuxt generate
This commit is contained in:
parent
7a103e0e95
commit
821f001e73
@ -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',
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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>
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user