Skip to content

Commit 6ff2823

Browse files
committed
feat: add vue-script snippets
1 parent 787bc3c commit 6ff2823

File tree

3 files changed

+46
-10
lines changed

3 files changed

+46
-10
lines changed

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,12 @@
3333
"language": "vue",
3434
"path": "./snippets/vue.json"
3535
},
36-
{
37-
"language": "html",
38-
"path": "./snippets/vue-template.json"
39-
},
4036
{
4137
"language": "vue-html",
4238
"path": "./snippets/vue-template.json"
4339
},
4440
{
45-
"language": "javascript",
41+
"language": "vue",
4642
"path": "./snippets/vue-script.json"
4743
},
4844
{

snippets/vue-script.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,27 @@
1010
],
1111
"description": "Vue Data"
1212
},
13+
"Vue Props": {
14+
"prefix": "vprops",
15+
"body": [
16+
"props: {",
17+
" value: {",
18+
" type: String,",
19+
" default: ''",
20+
" }",
21+
"}"
22+
],
23+
"description": "Vue Props"
24+
},
25+
"Vue Components": {
26+
"prefix": "vcomp",
27+
"body": [
28+
"components: {",
29+
"",
30+
"}"
31+
],
32+
"description": "Vue Components"
33+
},
1334
"Vue Method": {
1435
"prefix": "vmethod",
1536
"body": [
@@ -20,5 +41,26 @@
2041
"},"
2142
],
2243
"description": "Vue Method"
44+
},
45+
"Vue Watch": {
46+
"prefix": "vwatch",
47+
"body": [
48+
"watch: {",
49+
" value: {",
50+
" handler: 'fetchData',",
51+
" immediate: true",
52+
" }",
53+
"}"
54+
],
55+
"description": "Vue Watch"
56+
},
57+
"Vue Created": {
58+
"prefix": "vcreated",
59+
"body": [
60+
"created () {",
61+
"",
62+
"}"
63+
],
64+
"description": "Vue Created"
2365
}
2466
}

snippets/vue.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
"</template>",
3434
"",
3535
"<script>",
36-
"import { mapState, mapActions } from 'vuex'",
36+
"import { mapGetters } from 'vuex'",
3737
"export default {",
3838
" name: '${1:name}',",
3939
"",
4040
" computed: {",
41-
" ...mapState([",
41+
" ...mapGetters([",
4242
"",
4343
" ])",
4444
" },",
@@ -50,9 +50,7 @@
5050
" },",
5151
"",
5252
" methods: {",
53-
" ...mapActions([",
5453
"",
55-
" ])",
5654
" },",
5755
"",
5856
" created () {",
@@ -70,4 +68,4 @@
7068
],
7169
"description": "Vue View Component"
7270
}
73-
}
71+
}

0 commit comments

Comments
 (0)