Skip to content

Commit e5f132f

Browse files
authored
Update usage.md
1 parent 461ab81 commit e5f132f

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

docs/usage.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
**`asyncData`**
66

77
```js
8-
async asyncData({ app }) {
9-
const ip = await app.$axios.$get('http://icanhazip.com')
8+
async asyncData({ $axios }) {
9+
const ip = await $axios.$get('http://icanhazip.com')
1010
return { ip }
1111
}
1212
```
@@ -22,16 +22,7 @@ methods: {
2222
}
2323
```
2424

25-
### Store `nuxtServerInit`
26-
27-
```js
28-
async nuxtServerInit ({ commit }, { app }) {
29-
const ip = await app.$axios.$get('http://icanhazip.com')
30-
commit('SET_IP', ip)
31-
}
32-
```
33-
34-
### Store actions
25+
### Store actions (including `nuxtServerInit`)
3526

3627
```js
3728
// In store

0 commit comments

Comments
 (0)