-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathnuxt-script.code-snippets
83 lines (83 loc) · 2.23 KB
/
nuxt-script.code-snippets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{
"Nuxt useFetch": {
"prefix": "nfetch",
"body": [
"const { data: ${1:name} } = await useFetch('${2:path}')"
],
"description": "Nuxt useFetch composable"
},
"Nuxt useLazyFetch": {
"prefix": "nfetch-lazy",
"body": [
"const { pending, data: ${1:name} } = await useLazyFetch('${2:path}')"
],
"description": "Nuxt useLazyFetch composable"
},
"Nuxt useAsyncData": {
"prefix": "nasyncdata",
"body": [
"const { data: ${1:name} } = await useAsyncData('${2:requestKey}', () => \\$fetch('${3:path}'))"
],
"description": "Nuxt useAsyncData composable"
},
"Nuxt useLazyAsyncData": {
"prefix": "nasyncdata-lazy",
"body": [
"const { pending, data: ${1:name} } = await useLazyAsyncData('${2:requestKey}', () => \\$fetch('${3:path}'))"
],
"description": "Nuxt useLazyAsyncData composable"
},
"Nuxt useHead": {
"prefix": "nhead",
"body": [
"useHead({",
"\ttitle: ${1:pageTitle},",
"})"
],
"description": "Nuxt useHead composable"
},
"Nuxt useHead with description": {
"prefix": "nhead-description",
"body": [
"useHead({",
"\ttitle: ${1:pageTitle},",
"\tmeta: [",
"\t\t{ name: 'description', content: ${2:pageDescription} },",
"\t],",
"})"
],
"description": "Nuxt useHead composable with description"
},
"Nuxt useHead - Title template": {
"prefix": "nhead-template",
"body": [
"useHead({",
"\ttitleTemplate: (titleChunk) => {",
"\t\treturn titleChunk ? `\\${titleChunk} - ${1:siteTitle}` : '${1:siteTitle}'",
"\t}",
"})"
],
"description": "Nuxt useHead composable with title template"
},
"Nuxt definePageMeta": {
"prefix": "npagemeta",
"body": [
"definePageMeta({",
"\ttitle: '${1:pageTitle}',",
"})"
],
"description": "Nuxt definePageMeta composable"
},
"Nuxt definePageMeta with description": {
"prefix": "npagemeta-description",
"body": [
"definePageMeta({",
"\ttitle: '${1:pageTitle}',",
"\tmeta: [",
"\t\t{ name: 'description', content: '${2:pageDescription}' },",
"\t],",
"})"
],
"description": "Nuxt definePageMeta composable with description"
},
}