Skip to content

Commit 4b62364

Browse files
clarkdopi0
authored andcommitted
fix: with-firebase example
1 parent 7cd22a4 commit 4b62364

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

examples/with-firebase/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"license": "MIT",
1616
"dependencies": {
1717
"axios": "^0.15.3",
18-
"nuxt": "^0.9.9"
18+
"nuxt": "latest"
1919
}
2020
}

examples/with-firebase/pages/index.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@
2828
</template>
2929

3030
<script>
31-
import axios from '~plugins/axios'
31+
import axios from '~/plugins/axios'
3232
3333
export default {
34-
async data() {
35-
const { data } = await axios.get('users.json')
36-
return {
37-
users: data
38-
}
34+
async asyncData () {
35+
const { data: users } = await axios.get('users.json')
36+
return { users }
3937
}
4038
}
4139
</script>

examples/with-firebase/pages/users/_key.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
</template>
1212

1313
<script>
14-
import axios from '~plugins/axios'
14+
import axios from '~/plugins/axios'
1515
1616
export default {
17-
async data({ route }) {
17+
async asyncData ({ route }) {
1818
const { key } = route.params
19-
const { data } = await axios.get(`users/${key}.json`)
20-
return {
21-
user: data
22-
}
19+
const { data: user } = await axios.get(`users/${key}.json`)
20+
return { user }
2321
}
2422
}
2523
</script>

0 commit comments

Comments
 (0)