Update example

This commit is contained in:
Sébastien Chopin 2017-07-08 18:05:44 +02:00
parent 209beb0677
commit 1f7508d033
2 changed files with 4 additions and 10 deletions

View File

@ -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": {

View File

@ -9,14 +9,9 @@
<script> <script>
export default { export default {
asyncData ({ req }, callback) { asyncData: ({ req }) => ({
setTimeout(function () {
// callback(err, data)
callback(null, {
userAgent: (req ? req.headers['user-agent'] : navigator.userAgent) userAgent: (req ? req.headers['user-agent'] : navigator.userAgent)
}) })
}, 100)
}
} }
</script> </script>