mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Update example
This commit is contained in:
parent
209beb0677
commit
1f7508d033
@ -1,8 +1,7 @@
|
||||
{
|
||||
"name": "nuxt-async-data",
|
||||
"description": "",
|
||||
"dependencies": {
|
||||
"axios": "^0.15.2",
|
||||
"axios": "latest",
|
||||
"nuxt": "latest"
|
||||
},
|
||||
"scripts": {
|
||||
|
@ -9,14 +9,9 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
asyncData ({ req }, callback) {
|
||||
setTimeout(function () {
|
||||
// callback(err, data)
|
||||
callback(null, {
|
||||
userAgent: (req ? req.headers['user-agent'] : navigator.userAgent)
|
||||
})
|
||||
}, 100)
|
||||
}
|
||||
asyncData: ({ req }) => ({
|
||||
userAgent: (req ? req.headers['user-agent'] : navigator.userAgent)
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user