mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix: with-firebase example
This commit is contained in:
parent
7cd22a44e7
commit
4b6236499c
@ -15,6 +15,6 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^0.15.3",
|
||||
"nuxt": "^0.9.9"
|
||||
"nuxt": "latest"
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user