Skip to content

Commit eee2bfe

Browse files
committed
feat: release 1.2.0
1 parent 6ae1e4f commit eee2bfe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+445
-274
lines changed

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.18.0

README.md

+27-28
Large diffs are not rendered by default.

art/assets/newVue.png

-9.24 KB
Loading

art/assets/vue-language-blocks.png

21 KB
Loading

package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Vue 3 Snippets",
55
"description": "Code snippets for Vue 3 (Only Vue 3.x, Vue Router 4.x)",
66
"icon": "art/icon.png",
7-
"version": "1.1.0",
7+
"version": "1.2.0",
88
"type": "module",
99
"galleryBanner": {
1010
"color": "#ffffff",
@@ -114,10 +114,8 @@
114114
]
115115
},
116116
"devDependencies": {
117+
"@vscode/vsce": "^3.2.1",
117118
"glob": "^10.3.10",
118119
"nodemon": "^3.1.0"
119-
},
120-
"peerDependencies": {
121-
"@vscode/vsce": "^2.24.0"
122120
}
123121
}

src/css/transition.json

+30
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,35 @@
3838
" ",
3939
"}"
4040
]
41+
},
42+
"Deep Selectors": {
43+
"prefix": "deep",
44+
"body": [
45+
"${1:selector} :deep(${2:child}) {",
46+
" $0",
47+
"}"
48+
]
49+
},
50+
"Slotted Selectors": {
51+
"prefix": "slotted",
52+
"body": [
53+
"${1:selector} :slotted(${2:child}) {",
54+
" $0",
55+
"}"
56+
]
57+
},
58+
"Global Selectors": {
59+
"prefix": "global",
60+
"body": [
61+
":global(${1:selector}) {",
62+
" $0",
63+
"}"
64+
]
65+
},
66+
"v-bind": {
67+
"prefix": "v-bind",
68+
"body": [
69+
"v-bind:${1:prop}"
70+
]
4171
}
4272
}

src/html/built-in-directives.json src/html/4.built-ins/1.directives.json

+9
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@
8787
"</template>"
8888
]
8989
},
90+
"v-bind=\"$attrs\"": {
91+
"prefix": [
92+
"v-bind-$attrs",
93+
"vba"
94+
],
95+
"body": [
96+
"${1:v-bind=\"\\$attrs\"}$0"
97+
]
98+
},
9099
"v-on": {
91100
"prefix": "v-on",
92101
"body": [
File renamed without changes.

src/html/built-in-special-elements.json src/html/4.built-ins/3.special-elements.json

+8
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,13 @@
3333
"<slot name=\"${1:default}\" ${2::${3:prop}}=\"${4:var}\"$5></slot>"
3434
],
3535
"description": "Named Slots.\n"
36+
},
37+
"<slot>, Named, Scoped, Conditional": {
38+
"prefix": "slot-named-scoped-condition",
39+
"body": [
40+
"<div v-if=\"\\$slots.${1:default}\">",
41+
" <slot name=\"${1:default}\" ${2::${3:prop}}=\"${4:var}\"$5></slot>",
42+
"</div>"
43+
]
3644
}
3745
}
File renamed without changes.

src/html/transition-events.json src/html/4.built-ins/transition-events.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@after-appear=\"${1:onAfterAppear}\""
4848
]
4949
},
50-
"@appear-cancelled": {
50+
"@appear-cancelled (v-show only)": {
5151
"prefix": [
5252
"transition-on-appear-cancelled"
5353
],

src/javascript/1.global-api/application.json src/javascript/1.global-api/1.application.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Vue: createApp()": {
3-
"prefix": "createApp",
3+
"prefix": ["createApp", "app"],
44
"body": [
55
"import { createApp } from 'vue';",
66
"import App from './App.vue';",

src/javascript/1.global-api/general.json src/javascript/1.global-api/3.general.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"Vue: nextTick()": {
3-
"prefix": "nextTick",
3+
"prefix": [
4+
"nextTick",
5+
"ntt"
6+
],
47
"body": [
58
"nextTick().then(() => {",
69
" $1",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"Composition API - Setup Context: emit()": {
3+
"prefix": [
4+
"emit",
5+
"e"
6+
],
7+
"body": [
8+
"emit('${1:event-name}'${2:, ${3:param}});$0"
9+
],
10+
"description": "Emits an event from the component.\nsetup(props, { emit, expose, attrs, slots })\n* Attributes (Non-reactive object, equivalent to $attrs);\n* Slots (Non-reactive object, equivalent to $slots);\n* Emit events (Function, equivalent to $emit);\n* Expose public properties (Function).\n"
11+
},
12+
"Composition API - Setup Context: expose()": {
13+
"prefix": [
14+
"expose",
15+
"ex"
16+
],
17+
"body": [
18+
"expose({",
19+
" $1",
20+
"});$0"
21+
],
22+
"description": "Exposes a function or object from the component.\nsetup(props, { emit, expose, attrs, slots })\n"
23+
}
24+
}

src/javascript/2.composition-api/reactivity-core.json src/javascript/2.composition-api/2.reactivity-core.json

+15-11
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@
1515
"c"
1616
],
1717
"body": [
18-
"const ${3:feature} = computed(() => ${1:state.value});"
18+
"const ${1:feature} = computed(() => ${2:state.value});"
1919
],
2020
"description": "Reactivity API - Computed and watch.\nTakes a getter function and returns an immutable reactive ref object for the returned value from the getter.\n"
2121
},
2222
"Composition API: computed({ get, set })": {
2323
"prefix": "computed",
2424
"body": [
25-
"const ${3:feature} = computed({",
26-
" get: () => ${1:state.value},",
25+
"const ${1:feature} = computed({",
26+
" get: () => ${2:state.value},",
2727
" set: (newValue) => {",
28-
" ${1:state.value} = newValue;",
28+
" ${2:state.value} = newValue;",
2929
" },",
3030
"});"
3131
],
@@ -76,11 +76,14 @@
7676
"description": "Alias of watchEffect() with flush: 'sync' option.\n"
7777
},
7878
"Composition API: watch(), props": {
79-
"prefix": "watch",
79+
"prefix": [
80+
"watch-props",
81+
"w"
82+
],
8083
"body": [
8184
"watch(",
8285
" () => props.${1:property},",
83-
" async (newValue) => {",
86+
" async (${2:newValue}) => {",
8487
" $0",
8588
" },",
8689
");",
@@ -96,7 +99,7 @@
9699
"body": [
97100
"watch(",
98101
" () => props.${1:property},",
99-
" async (newValue) => {",
102+
" async (${2:newValue}) => {",
100103
" $0",
101104
" },",
102105
" {",
@@ -115,7 +118,7 @@
115118
"body": [
116119
"watch(",
117120
" () => props.${1:property},",
118-
" async (newValue) => {",
121+
" async (${2:newValue}) => {",
119122
" $0",
120123
" },",
121124
" {",
@@ -134,7 +137,7 @@
134137
"body": [
135138
"watch(",
136139
" () => props.${1:property},",
137-
" async (newValue) => {",
140+
" async (${2:newValue}) => {",
138141
" $0",
139142
" },",
140143
" {",
@@ -148,8 +151,8 @@
148151
},
149152
"Composition API: watch(), props, immediate, multiple": {
150153
"prefix": [
151-
"watch-props-immediate-multiple",
152-
"wmi"
154+
"watch-props-deep-immediate-multiple",
155+
"wdim"
153156
],
154157
"body": [
155158
"watch(",
@@ -158,6 +161,7 @@
158161
" $0",
159162
" },",
160163
" {",
164+
" deep: true,",
161165
" immediate: true,",
162166
" }",
163167
");",

src/javascript/2.composition-api/reactivity-advanced.json src/javascript/2.composition-api/4.reactivity-advanced.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"Composition API: shallowRef()": {
3-
"prefix": "shallowRef",
3+
"prefix": [
4+
"shallowRef",
5+
"sr"
6+
],
47
"body": [
58
"const ${1:state} = shallowRef(${2:original});"
69
]

src/javascript/2.composition-api/lifecycle-hooks.json src/javascript/2.composition-api/5.lifecycle-hooks.json

+32-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"Composition API: onBeforeMount()": {
3-
"prefix": "onBeforeMount",
3+
"prefix": [
4+
"onBeforeMount",
5+
"obm"
6+
],
47
"body": [
58
"onBeforeMount(() => {",
69
" $1",
@@ -9,7 +12,10 @@
912
"description": "Composition API: Lifecycle Hooks.\nRegisters a hook to be called right before the component is to be mounted.\n"
1013
},
1114
"Composition API: onMounted()": {
12-
"prefix": "onMounted",
15+
"prefix": [
16+
"onMounted",
17+
"om"
18+
],
1319
"body": [
1420
"onMounted(() => {",
1521
" $1",
@@ -18,7 +24,10 @@
1824
"description": "Composition API: Lifecycle Hooks.\nRegisters a callback to be called after the component has been mounted.\n"
1925
},
2026
"Composition API: onBeforeUpdate()": {
21-
"prefix": "onBeforeUpdate",
27+
"prefix": [
28+
"onBeforeUpdate",
29+
"obu"
30+
],
2231
"body": [
2332
"onBeforeUpdate(() => {",
2433
" $1",
@@ -27,7 +36,10 @@
2736
"description": "Composition API: Lifecycle Hooks.\nRegisters a hook to be called right before the component is about to update its DOM tree due to a reactive state change.\n"
2837
},
2938
"Composition API: onUpdated()": {
30-
"prefix": "onUpdated",
39+
"prefix": [
40+
"onUpdated",
41+
"ou"
42+
],
3143
"body": [
3244
"onUpdated(() => {",
3345
" $1",
@@ -36,7 +48,10 @@
3648
"description": "Composition API: Lifecycle Hooks.\nRegisters a callback to be called after the component has updated its DOM tree due to a reactive state change.\n"
3749
},
3850
"Composition API: onBeforeUnmount()": {
39-
"prefix": "onBeforeUnmount",
51+
"prefix": [
52+
"onBeforeUnmount",
53+
"obum"
54+
],
4055
"body": [
4156
"onBeforeUnmount(() => {",
4257
" $1",
@@ -45,7 +60,10 @@
4560
"description": "Composition API: Lifecycle Hooks.\nRegisters a hook to be called right before a component instance is to be unmounted.\n"
4661
},
4762
"Composition API: onUnmounted()": {
48-
"prefix": "onUnmounted",
63+
"prefix": [
64+
"onUnmounted",
65+
"oum"
66+
],
4967
"body": [
5068
"onUnmounted(() => {",
5169
" $1",
@@ -108,15 +126,21 @@
108126
"description": "SSR only.\nComposition API: Lifecycle Hooks.\nRegisters an async function to be resolved before the component instance is to be rendered on the server.\n"
109127
},
110128
"Composition API: async onBeforeMount()": {
111-
"prefix": "async-onBeforeMount",
129+
"prefix": [
130+
"async-onBeforeMount",
131+
"asobm"
132+
],
112133
"body": [
113134
"onBeforeMount(async () => {",
114135
" $1",
115136
"});$0"
116137
]
117138
},
118139
"Composition API: async onMounted()": {
119-
"prefix": "async-onMounted",
140+
"prefix": [
141+
"async-onMounted",
142+
"asom"
143+
],
120144
"body": [
121145
"onMounted(async () => {",
122146
" $1",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"Composition API Helpers: useAttrs()": {
3+
"prefix": [
4+
"useAttrs",
5+
"ua"
6+
],
7+
"body": [
8+
"const attrs = useAttrs();"
9+
],
10+
"description": "Used in `<script setup>`.\n"
11+
},
12+
"Composition API Helpers: useSlots()": {
13+
"prefix": [
14+
"useSlots",
15+
"us"
16+
],
17+
"body": [
18+
"const slots = useSlots();"
19+
],
20+
"description": "Used in `<script setup>`.\n"
21+
},
22+
"Composition API Helpers: useModel()": {
23+
"prefix": [
24+
"useModel",
25+
"um"
26+
],
27+
"body": [
28+
"const ${1:model} = useModel(props, '${3:key}');"
29+
],
30+
"description": "Used in `setup(props) { }`.\n If using `<script setup>`, `defineModel()` should be preferred instead.\n"
31+
},
32+
"Composition API Helpers: useTemplateRef()": {
33+
"prefix": [
34+
"useTemplateRef",
35+
"utr"
36+
],
37+
"body": [
38+
"const ${1:elementRef} = useTemplateRef('${2:refName}');"
39+
],
40+
"description": "Used in `<script setup>`.\n"
41+
},
42+
"Composition API Helpers: useId()": {
43+
"prefix": "useId",
44+
"body": [
45+
"const id = useId();"
46+
],
47+
"description": "Used in `<script setup>`.\n"
48+
}
49+
}

0 commit comments

Comments
 (0)