Skip to content

Commit 142d3a7

Browse files
committed
feat: add more snippets
1 parent c4898f3 commit 142d3a7

File tree

5 files changed

+129
-3
lines changed

5 files changed

+129
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Vscode Snippets Ntnyq
1+
# Vue Snippets Ntnyq
22

33
__WIP__

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"displayName": "Vue Snippets Ntnyq",
44
"description": "Vue snippets speed up your development",
55
"version": "0.0.1",
6+
"scripts": {
7+
"build": "vsce package -o vue-vscode-snippets-$npm_package_version.vsix",
8+
"install": "yarn build && code --install-extension vue-vscode-snippets-$npm_package_version.vsix"
9+
},
610
"icon": "images/vue-logo.png",
711
"engines": {
812
"vscode": "^1.32.0"
@@ -43,6 +47,10 @@
4347
{
4448
"language": "javascript",
4549
"path": "./snippets/vue-script-vuex.json"
50+
},
51+
{
52+
"language": "javascript",
53+
"path": "./snippets/vue-script-router.json"
4654
}
4755
]
4856
}

snippets/vue-script-router.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"Vue Router Base": {
3+
"prefix": "vrbase",
4+
"body": [
5+
"import Vue from 'vue'",
6+
"import VueRouter from 'vue-router'",
7+
"import routes from './routes'",
8+
"",
9+
"Vue.use(VueRouter)",
10+
"",
11+
"const router = new VueRouter({",
12+
" routes",
13+
"})",
14+
"",
15+
"export default router",
16+
""
17+
],
18+
"description": "Vue Router Base"
19+
},
20+
"Vue Router Import": {
21+
"prefix": "vrimport",
22+
"body": [
23+
"import router from '@/router'",
24+
""
25+
],
26+
"description": "Vue Router Import"
27+
}
28+
}

snippets/vue-script-vuex.json

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,68 @@
1-
{}
1+
{
2+
"Vuex Base": {
3+
"prefix": "vxbase",
4+
"body": [
5+
"import Vue from 'vue'",
6+
"import Vuex from 'vuex'",
7+
"import getters from './getters'",
8+
"import modules from './modules'",
9+
"",
10+
"Vue.use(Vuex)",
11+
"",
12+
"const state = {",
13+
"",
14+
"}",
15+
"",
16+
"const actions = {",
17+
"",
18+
"}",
19+
"",
20+
"const mutations = {",
21+
"",
22+
"}",
23+
"",
24+
"const store = new Vuex.Store({",
25+
" state,",
26+
" actions,",
27+
" mutations,",
28+
" getters,",
29+
" modules",
30+
"})",
31+
"",
32+
"export default store",
33+
""
34+
],
35+
"description": "Vuex Base"
36+
},
37+
"Vuex Module": {
38+
"prefix": "vxmodule",
39+
"body": [
40+
"const state = {",
41+
"",
42+
"}",
43+
"",
44+
"const actions = {",
45+
"",
46+
"}",
47+
"",
48+
"const mutations = {",
49+
"",
50+
"}",
51+
"",
52+
"export default {",
53+
" state,",
54+
" actions,",
55+
" mutations",
56+
"}",
57+
""
58+
],
59+
"description": "Vuex Module"
60+
},
61+
"Vuex Import": {
62+
"prefix": "vximport",
63+
"body": [
64+
"import store from '@/store'"
65+
],
66+
"description": "Vuex Import"
67+
}
68+
}

snippets/vue-script.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
1-
{}
1+
{
2+
"Vue Data": {
3+
"prefix": "vdata",
4+
"body": [
5+
"data () {",
6+
" return {",
7+
" ${1:isLoading}: ${2:false}",
8+
" }",
9+
"},"
10+
],
11+
"description": "Vue Data"
12+
},
13+
"Vue Method": {
14+
"prefix": "vmethod",
15+
"body": [
16+
"methods: {",
17+
" ${1:fetchData} () {",
18+
"",
19+
" }",
20+
"},"
21+
],
22+
"description": "Vue Method"
23+
}
24+
}

0 commit comments

Comments
 (0)