Skip to content

Commit 74d861b

Browse files
authored
Merge pull request #69 from zwik/master
Fix a couple of inconsistenties e.g. missing semi colons and missing braces
2 parents dbc25ed + 504a227 commit 74d861b

File tree

2 files changed

+29
-29
lines changed

2 files changed

+29
-29
lines changed

snippets/vue-script-router.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"\tmode: 'history',",
1313
"\troutes: [",
1414
"\t\t{ path: '/path', component: component }",
15-
"\t}",
15+
"\t]",
1616
"});"
1717
],
1818
"description": "Base for Vue Router"
@@ -35,7 +35,7 @@
3535
"body": [
3636
"router.beforeEach((to, from, next) => {",
3737
"\t${1:next();}",
38-
"};"
38+
"});"
3939
],
4040
"description": "Vue Router global guards beforeEach"
4141
},
@@ -44,7 +44,7 @@
4444
"body": [
4545
"router.beforeResolve((to, from, next) => {",
4646
"\t${1:next();}",
47-
"};"
47+
"});"
4848
],
4949
"description": "Vue Router global guards beforeResolve"
5050
},
@@ -53,7 +53,7 @@
5353
"body": [
5454
"router.afterEach((to, from) => {",
5555
"\t",
56-
"};"
56+
"});"
5757
],
5858
"description": "Vue Router global guards afterEach"
5959
},

snippets/vue-script.json

+25-25
Original file line numberDiff line numberDiff line change
@@ -111,73 +111,73 @@
111111
"Vue Import Export": {
112112
"prefix": "vimport-export",
113113
"body": [
114-
"import ${1:Name} from '@/components/${1:Name}.vue'",
114+
"import ${1:Name} from '@/components/${1:Name}.vue';",
115115
"",
116116
"export default {",
117117
"\tcomponents: {",
118118
"\t\t${1:Name}",
119119
"\t},",
120-
"}"
120+
"};"
121121
],
122122
"description": "import a component and include it in export default"
123123
},
124124
"Vue MapState": {
125125
"prefix": "vmapstate",
126126
"body": [
127-
"import { mapState } from 'vuex'",
127+
"import { mapState } from 'vuex';",
128128
"",
129129
"export default {",
130130
"\tcomputed: {",
131131
"\t\t...mapState([",
132132
"\t\t\t${1:'nameOfState'},",
133133
"\t\t])",
134134
"\t},",
135-
"}"
135+
"};"
136136
],
137137
"description": "map getters inside a vue component"
138138
},
139139
"Vue MapGetters": {
140140
"prefix": "vmapgetters",
141141
"body": [
142-
"import { mapGetters } from 'vuex'",
142+
"import { mapGetters } from 'vuex';",
143143
"",
144144
"export default {",
145145
"\tcomputed: {",
146146
"\t\t...mapGetters([",
147147
"\t\t\t${1:'nameOfGetter'},",
148148
"\t\t])",
149149
"\t},",
150-
"}"
150+
"};"
151151
],
152152
"description": "mapgetters inside a vue component"
153153
},
154154
"Vue MapMutations": {
155155
"prefix": "vmapmutations",
156156
"body": [
157-
"import { mapMutations } from 'vuex'",
157+
"import { mapMutations } from 'vuex';",
158158
"",
159159
"export default {",
160160
"\tmethods: {",
161161
"\t\t...mapMutations([",
162162
"\t\t\t${1:'nameOfMutation'}, //also supports payload `this.nameOfMutation(amount)` ",
163163
"\t\t])",
164164
"\t},",
165-
"}"
165+
"};"
166166
],
167167
"description": "mapmutations inside a vue component"
168168
},
169169
"Vue MapActions": {
170170
"prefix": "vmapactions",
171171
"body": [
172-
"import { mapActions } from 'vuex'",
172+
"import { mapActions } from 'vuex';",
173173
"",
174174
"export default {",
175175
"\tmethods: {",
176176
"\t\t...mapActions([",
177177
"\t\t\t${1:'nameOfAction'}, //also supports payload `this.nameOfAction(amount)` ",
178178
"\t\t])",
179179
"\t},",
180-
"}"
180+
"};"
181181
],
182182
"description": "mapactions inside a vue component"
183183
},
@@ -197,9 +197,9 @@
197197
"body": [
198198
"const ${1:mixinName} = {",
199199
"\tmounted() {",
200-
"\t\tconsole.log('hello from mixin!')",
200+
"\t\tconsole.log('hello from mixin!');",
201201
"\t},",
202-
"}"
202+
"};"
203203
],
204204
"description": "vue mixin"
205205
},
@@ -221,12 +221,12 @@
221221
},
222222
"Vue Import Library": {
223223
"prefix": "vimport-lib",
224-
"body": ["import { ${1:libName} } from '${1:libName}'"],
224+
"body": ["import { ${1:libName} } from '${1:libName}';"],
225225
"description": "import a library"
226226
},
227227
"Vue Import GSAP": {
228228
"prefix": "vimport-gsap",
229-
"body": ["import { TimelineMax, ${1:Ease} } from 'gsap'"],
229+
"body": ["import { TimelineMax, ${1:Ease} } from 'gsap';"],
230230
"description":
231231
"component methods options that dispatch an action from vuex store."
232232
},
@@ -254,7 +254,7 @@
254254
"prefix": "vcommit",
255255
"body": [
256256
"${1:mutationName}() {",
257-
"\tthis.\\$store.commit('${1:mutationName}', ${2:payload})",
257+
"\tthis.\\$store.commit('${1:mutationName}', ${2:payload});",
258258
"}"
259259
],
260260
"description": "commit to vuex store in methods for mutation"
@@ -263,35 +263,35 @@
263263
"prefix": "vdispatch",
264264
"body": [
265265
"${1:actionName}() {",
266-
"\tthis.\\$store.dispatch('${1:actionName}', ${2:payload})",
266+
"\tthis.\\$store.dispatch('${1:actionName}', ${2:payload});",
267267
"}"
268268
],
269269
"description": "dispatch to vuex store in methods for action"
270270
},
271271
"Incrementer": {
272272
"prefix": "vinc",
273-
"body": ["return ${1:this.num} += ${2:1}"],
273+
"body": ["return ${1:this.num} += ${2:1};"],
274274
"description": "increment"
275275
},
276276
"Decrementer": {
277277
"prefix": "vdec",
278-
"body": ["return ${1:this.num} -= ${2:1}"],
278+
"body": ["return ${1:this.num} -= ${2:1};"],
279279
"description": "decrement"
280280
},
281281
"Unit Test": {
282282
"prefix": "vtest",
283283
"body": [
284-
"import Vue from 'vue'",
285-
"import ${1:HelloWorld} from './components/${1:HelloWorld}'",
284+
"import Vue from 'vue';",
285+
"import ${1:HelloWorld} from './components/${1:HelloWorld}';",
286286
"",
287287
"describe('${1:HelloWorld}.vue', () => {",
288288
"\tit('${2:should render correct contents}', () => {",
289-
"\t\tconst Constructor = Vue.extend(${1:HelloWorld})",
290-
"\t\tconst vm = new Constructor().$mount()",
289+
"\t\tconst Constructor = Vue.extend(${1:HelloWorld});",
290+
"\t\tconst vm = new Constructor().$mount();",
291291
"\t\texpect(vm.$el.querySelector('.hello h1').textContent)",
292-
"\t\t\t.to.equal(${3:'Welcome to Your Vue.js App'})",
293-
"\t})",
294-
"})"
292+
"\t\t\t.to.equal(${3:'Welcome to Your Vue.js App'});",
293+
"\t});",
294+
"});"
295295
],
296296
"description": "unit test component"
297297
},

0 commit comments

Comments
 (0)