Skip to content

Commit ba5c565

Browse files
committed
add in boilerplate for merging composition and options api
1 parent 9890f91 commit ba5c565

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

CHANGELOG.md

+4
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.3
6+
7+
- Add in boilerplate to use Composition API inside Options API
8+
59
## 2.1.2
610

711
- Add in Vue 3 Composition API with Reactive boilerplate script

README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set
111111

112112
| Snippet | Purpose |
113113
| ------------------- | ----------------------------------------------------- |
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 |
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 |
120120
| `v3ref` | Vue Ref |
121121
| `v3onmounted` | Lifecycle hook - onMounted |
122122
| `v3onbeforemount` | Lifecycle hook - onBeforeMount |
@@ -125,6 +125,7 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set
125125
| `v3onerrorcaptured` | Lifecycle hook - onErrorCaptured |
126126
| `v3onunmounted` | Lifecycle hook - (destroyed) onUnmounted |
127127
| `v3onbeforeunmount` | Lifecycle hook - (beforeDestroy) onBeforeUnmount |
128+
| `v3useinoptions` | Use Composition API in Options API |
128129

129130
### Vuex
130131

package.json

+1-1
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.2",
6+
"version": "2.1.3",
77
"publisher": "sdras",
88
"engines": {
99
"vscode": "^1.14.0"

snippets/vue-script.json

+17
Original file line numberDiff line numberDiff line change
@@ -411,5 +411,22 @@
411411
"}"
412412
],
413413
"description": "Vue Composition API Script with Reactive"
414+
},
415+
"Use Composition API within Options API": {
416+
"prefix": "v3useinoptions",
417+
"body": [
418+
"import { ${0:component} } from '@/composables/${0:component}.js'",
419+
"",
420+
"export default {",
421+
"\tsetup () {",
422+
"\t\tconst { ${1:name} } = ${0:component}()",
423+
"\t",
424+
"\t\treturn {",
425+
"\t\t\t${1:name}",
426+
"\t\t}",
427+
"\t}",
428+
"}"
429+
],
430+
"description": "Use Composition API within Options API"
414431
}
415432
}

0 commit comments

Comments
 (0)