Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.

Commit 9890f91

Browse files
committed
add in reactive script and increment version
1 parent 3117f61 commit 9890f91

File tree

4 files changed

+40
-16
lines changed

4 files changed

+40
-16
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
All notable changes to the "vue-vscode-snippets" extension will be documented in this file.
44

5+
## 2.1.2
6+
7+
- Add in Vue 3 Composition API with Reactive boilerplate script
8+
59
## 2.1.1
610

711
- Update readme to reflect Vue 3 support

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,22 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set
109109

110110
### Vue Composition API
111111

112-
| Snippet | Purpose |
113-
| ------------------- | ------------------------------------------------ |
114-
| `v3reactive` | Vue Composition api - reactive |
115-
| `v3computed` | Vue Composition api - computed |
116-
| `v3watch` | Vue Composition api - watcher single source |
117-
| `v3watch-array` | Vue Composition api - watch as array |
118-
| `v3watcheffect` | Vue Composition api - watchEffect |
119-
| `v3ref` | Vue Ref |
120-
| `v3onmounted` | Lifecycle hook - onMounted |
121-
| `v3onbeforemount` | Lifecycle hook - onBeforeMount |
122-
| `v3onbeforeupdate` | Lifecycle hook - onBeforeUpdate |
123-
| `v3onupdated` | Lifecycle hook - onUpdated |
124-
| `v3onerrorcaptured` | Lifecycle hook - onErrorCaptured |
125-
| `v3onunmounted` | Lifecycle hook - (destroyed) onUnmounted |
126-
| `v3onbeforeunmount` | Lifecycle hook - (beforeDestroy) onBeforeUnmount |
112+
| Snippet | Purpose |
113+
| ------------------- | ----------------------------------------------------- |
114+
| `v3reactive` | Vue Composition api - reactive |
115+
| `v3reactive-setup` | Vue Composition api - reactive with setup boilerplate |
116+
| `v3computed` | Vue Composition api - computed |
117+
| `v3watch` | Vue Composition api - watcher single source |
118+
| `v3watch-array` | Vue Composition api - watch as array |
119+
| `v3watcheffect` | Vue Composition api - watchEffect |
120+
| `v3ref` | Vue Ref |
121+
| `v3onmounted` | Lifecycle hook - onMounted |
122+
| `v3onbeforemount` | Lifecycle hook - onBeforeMount |
123+
| `v3onbeforeupdate` | Lifecycle hook - onBeforeUpdate |
124+
| `v3onupdated` | Lifecycle hook - onUpdated |
125+
| `v3onerrorcaptured` | Lifecycle hook - onErrorCaptured |
126+
| `v3onunmounted` | Lifecycle hook - (destroyed) onUnmounted |
127+
| `v3onbeforeunmount` | Lifecycle hook - (beforeDestroy) onBeforeUnmount |
127128

128129
### Vuex
129130

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Vue VSCode Snippets",
44
"description": "Snippets that will supercharge your Vue workflow",
55
"icon": "images/vue-logo.png",
6-
"version": "2.1.1",
6+
"version": "2.1.2",
77
"publisher": "sdras",
88
"engines": {
99
"vscode": "^1.14.0"

snippets/vue-script.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,5 +392,24 @@
392392
"Vue.use(${1:VueCompositionApi})"
393393
],
394394
"description": "Import a plugin to main.js or plugins file"
395+
},
396+
"Vue Composition API Reactive Script": {
397+
"prefix": "v3reactive-setup",
398+
"body": [
399+
"import { reactive, toRefs } from '@vue/composition-api'",
400+
"",
401+
"export default {",
402+
"\tsetup () {",
403+
"\t\tconst state = reactive({",
404+
"\t\t\t${0:count}: ${1:0},",
405+
"\t\t})",
406+
"\t",
407+
"\t\treturn {",
408+
"\t\t\t...toRefs(state),",
409+
"\t\t}",
410+
"\t}",
411+
"}"
412+
],
413+
"description": "Vue Composition API Script with Reactive"
395414
}
396415
}

0 commit comments

Comments
 (0)