fix: with-firebase example

This commit is contained in:
Clark Du 2017-10-19 17:25:19 +08:00 committed by Pooya Parsa
parent 7cd22a44e7
commit 4b6236499c
3 changed files with 9 additions and 13 deletions

View File

@ -15,6 +15,6 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"axios": "^0.15.3", "axios": "^0.15.3",
"nuxt": "^0.9.9" "nuxt": "latest"
} }
} }

View File

@ -28,14 +28,12 @@
</template> </template>
<script> <script>
import axios from '~plugins/axios' import axios from '~/plugins/axios'
export default { export default {
async data() { async asyncData () {
const { data } = await axios.get('users.json') const { data: users } = await axios.get('users.json')
return { return { users }
users: data
}
} }
} }
</script> </script>

View File

@ -11,15 +11,13 @@
</template> </template>
<script> <script>
import axios from '~plugins/axios' import axios from '~/plugins/axios'
export default { export default {
async data({ route }) { async asyncData ({ route }) {
const { key } = route.params const { key } = route.params
const { data } = await axios.get(`users/${key}.json`) const { data: user } = await axios.get(`users/${key}.json`)
return { return { user }
user: data
}
} }
} }
</script> </script>