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