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",
"dependencies": {
"axios": "^0.15.3",
"nuxt": "^0.9.9"
"nuxt": "latest"
}
}

View File

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

View File

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