File tree Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Expand file tree Collapse file tree 2 files changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -167,14 +167,17 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set
167
167
| ` nfont ` | link to include fonts in a nuxt project, in nuxt-config |
168
168
| ` ncss ` | link to css assets such as normalize |
169
169
170
+
170
171
### Nuxt Page
171
172
172
- | Snippet | Purpose |
173
- | ------------ | ----------------- |
174
- | ` nasyncdata ` | Nuxt asyncData |
175
- | ` nfetch ` | Nuxt Fetch |
176
- | ` nhead ` | Nuxt Head |
177
- | ` nparam ` | Nuxt Route Params |
173
+ | Snippet | Purpose |
174
+ | ----------------- | -------------------------------- |
175
+ | ` nasyncdata ` | Nuxt asyncData |
176
+ | ` nasyncdataaxios ` | Nuxt asyncData with Axios module |
177
+ | ` nfetch ` | Nuxt Fetch |
178
+ | ` nfetchaxios ` | Nuxt Fetch with Axios module |
179
+ | ` nhead ` | Nuxt Head |
180
+ | ` nparam ` | Nuxt Route Params |
178
181
179
182
### Extra (plaintext)
180
183
Original file line number Diff line number Diff line change 9
9
],
10
10
"description" : " Nuxt asyncData"
11
11
},
12
+ "Nuxt Async" : {
13
+ "prefix" : " nasyncdataaxios" ,
14
+ "body" : [
15
+ " async asyncData ({ ${1:$axios}, { ${2:params} }) {" ,
16
+ " \t const data = await $axios.$get(`${3:endpoint/${params.slug}}`)" ,
17
+ " \t return { data }" ,
18
+ " },"
19
+ ],
20
+ "description" : " Nuxt asyncData with Axios module"
21
+ },
12
22
"Nuxt Fetch" : {
13
23
"prefix" : " nfetch" ,
14
24
"body" : [
19
29
],
20
30
"description" : " Nuxt Fetch"
21
31
},
32
+ "Nuxt Fetch with Axios" : {
33
+ "prefix" : " nfetchaxios" ,
34
+ "body" : [
35
+ " async fetch () {" ,
36
+ " \t let this.data = await this.$axios.$get('${1:endpoint/${this.$route.params.slug}}')" ,
37
+ " },"
38
+ ],
39
+ "description" : " Nuxt Fetch with Axios module"
40
+ },
22
41
"Nuxt Route Params" : {
23
42
"prefix" : " nparam" ,
24
43
"body" : [" this.$route.params.${1:id}" ],
You can’t perform that action at this time.
0 commit comments