forked from sdras/vue-vscode-snippets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue-template.json
136 lines (136 loc) · 4.17 KB
/
vue-template.json
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{
"Vue v-for": {
"prefix": "vfor",
"body": [
"<${1:div} v-for=\"${2:item} in ${2:item}s\" :key=\"${2:item}.id\">",
"\t{{ ${2:item} }}",
"</${1:div}>"
],
"description": "vfor statement"
},
"Vue v-model Directive": {
"prefix": "vmodel",
"body": ["<input v-model=\"${1:data}\" type=\"text\" />"],
"description": "v-model directive"
},
"Vue v-model Number Directive": {
"prefix": "vmodel-num",
"body": [
"<input v-model.number=\"${1:numData}\" type=\"number\" step=\"1\" />"
],
"description": "v-model directive number input"
},
"Vue v-on Shortcut Directive": {
"prefix": "von",
"body": ["@click=\"${1:handler}(${2:arg}, $event)\""],
"description": "v-on click handler with arguments"
},
"Vue Component with Props Binding": {
"prefix": "vel-props",
"body": ["<${1:component} :${1:propName}=\"${0}\"></${1:component}>"],
"description": "component element with props"
},
"Vue Named Slot": {
"prefix": "vslot-named",
"body": ["<template v-slot:${0:name}>${1:defaultcontent}</template>"],
"description": "named slot"
},
"Vue Image Source Binding": {
"prefix": "vsrc",
"body": [
"<img :src=\"'/path/to/images/' + ${1:fileName}\" alt=\"${2:altText}\"/>"
],
"description": "image source binding"
},
"Vue Style Binding": {
"prefix": "vstyle",
"body": ["<${1:div} :style=\"{ fontSize: ${2:data} + 'px' }\"></${1:div}>"],
"description": "vue inline style binding"
},
"Vue Style Binding Object": {
"prefix": "vstyle-obj",
"body": [
"<${1:div} :style=\"[${2:styleObjectA}, ${3:styleObjectB]}\"></${1:div}>"
],
"description": "vue inline style binding, objects"
},
"Vue Class Binding": {
"prefix": "vclass",
"body": ["<${1:div} :class=\"{ ${2:className}: ${3:data} }\"></${1:div}>"],
"description": "vue class binding"
},
"Vue Class Binding Object": {
"prefix": "vclass-obj",
"body": [
"<${1:div} :class=\"[${2:classNameA}, ${3:classNameB}]\"></${1:div}>"
],
"description": "vue class binding"
},
"Vue Multiple Conditional Class Bindings": {
"prefix": "vclass-obj-mult",
"body": [
"<${1:div} :class=\"[${2:classNameA}, {${3:classNameB} : ${4:condition}}]\"></${1:div}>"
],
"description": "vue multiple conditional class bindings"
},
"Vue Emit from Child": {
"prefix": "vemit-child",
"body": ["@change=\"$$emit('change', $$event.target.value)\""],
"description": "Vue Emit from Child Component"
},
"Vue Emit to Parent": {
"prefix": "vemit-parent",
"body": ["@change=\"${1:foo} = $$event\""],
"description": "Vue Emit to Parent Component"
},
"Vue Transition Component with JavaScript Hooks": {
"prefix": "vanim",
"body": [
"<transition",
"\tmode=\"out-in\"",
"\t@before-enter=\"beforeEnter\"",
"\t@enter=\"enter\"",
"",
"\t@before-leave=\"beforeLeave\"",
"\t@leave=\"leave\"",
"\t:css=\"false\">",
"",
"</transition>"
],
"description": "transition component js hooks"
},
"Vue Nuxt Routing Link": {
"prefix": "vnuxtl",
"body": ["<nuxt-link to=\"/${1:page}\">${1:page}</nuxt-link>"],
"description": "nuxt routing link"
},
"Vue Named Routing Link": {
"prefix": "vroutename",
"body": [
"<router-link :to=\"{name: '${1:name}'}\">${2:LinkTitle}</router-link>"
],
"description": "Named routing link"
},
"Vue Named Routing Link with Params": {
"prefix": "vroutenameparam",
"body": [
"<router-link :to=\"{name: '${1:name}', params:{${2:id}: '${3:value}'} }\">${4:LinkTitle}</router-link>"
],
"description": "Named routing link w/ params"
},
"Vue Path Routing Link": {
"prefix": "vroutepath",
"body": ["<router-link to=\"${1:path}\">${2:LinkTitle}</router-link>"],
"description": "Path routing link"
},
"Vue Emit from Child": {
"prefix": "vemit-child",
"body": ["@change=\"$emit('change', $event.target.value)\""],
"description": "Vue Emit from Child Component"
},
"Vue Emit to Parent": {
"prefix": "vemit-parent",
"body": ["@change=\"${1:foo} = $event\""],
"description": "Vue Emit to Parent Component"
}
}