Skip to content

Commit 6b11f5d

Browse files
committed
add some snippets
1 parent d53235f commit 6b11f5d

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@
5454
##### template code file path
5555
> This plugin support you to customize your code snippet file as a template, just copy your template absolute path to the config item, it will work.But there is one thing you have to concern, the component name of your template file must be `ComponentName` as a placeholder, only in this way ,the plugin can to replace it with your input name.
5656
57+
#### Support Class Component Lifecircle Snippets
58+
59+
| Shortcut | LifeCircle hook |
60+
| -------- | --------------------- |
61+
| pbm | private beforeMount |
62+
| pm | private mounted |
63+
| pbu | private beforeUpdate |
64+
| pu | private updated |
65+
| pbd | private beforeDestroy |
66+
| pd | private destroyd |
67+
68+
69+
5770
### Package and Publish
5871

5972
[Doc](https://code.visualstudio.com/api/working-with-extensions/publishing-extension)

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
"displayName": "CreateVueClassComponent",
44
"description": "create vue class component",
55
"icon": "images/vue_logo.png",
6-
"version": "0.1.5",
6+
"version": "0.2.0",
77
"publisher": "pengfeiyuan",
88
"engines": {
99
"vscode": "^1.57.0"
1010
},
1111
"categories": [
12+
"Snippets",
1213
"Other"
1314
],
1415
"repository": {
@@ -84,6 +85,16 @@
8485
}
8586
}
8687
}
88+
],
89+
"snippets": [
90+
{
91+
"language": "typescript",
92+
"path": "./snippets/vue-class-component-lifecircle.json"
93+
},
94+
{
95+
"language": "javascript",
96+
"path": "./snippets/vue-class-component-lifecircle.json"
97+
}
8798
]
8899
},
89100
"scripts": {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"Vue Lifecycle beforeMount": {
3+
"prefix": "pbm",
4+
"body": ["private beforeMount () {", "\t${0}", "}"],
5+
"description": "beforeMount lifecycle method"
6+
},
7+
"Vue Lifecycle mounted": {
8+
"prefix": "pm",
9+
"body": ["private mounted () {", "\t${0}", "}"],
10+
"description": "mounted lifecycle method"
11+
},
12+
"Vue Lifecycle beforeUpdate": {
13+
"prefix": "pbu",
14+
"body": ["private beforeUpdate () {", "\t${0}", "}"],
15+
"description": "beforeUpdate lifecycle method"
16+
},
17+
"Vue Lifecycle updated": {
18+
"prefix": "pu",
19+
"body": ["private updated () {", "\t${0}", "}"],
20+
"description": "updated lifecycle method"
21+
},
22+
"Vue Lifecycle beforeDestroy": {
23+
"prefix": "pbd",
24+
"body": ["private beforeDestroy () {", "\t${0}", "}"],
25+
"description": "beforeDestroy lifecycle method"
26+
},
27+
"Vue Lifecycle destroyd": {
28+
"prefix": "pd",
29+
"body": ["private destroyd () {", "\t${0}", "}"],
30+
"description": "destroyd lifecycle method"
31+
}
32+
}

0 commit comments

Comments
 (0)