Skip to content

Commit ac97ae4

Browse files
committed
Add in reactive component base
1 parent 178c2bf commit ac97ae4

File tree

3 files changed

+45
-13
lines changed

3 files changed

+45
-13
lines changed

README.md

+13-12
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,19 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set
3232

3333
### Vue
3434

35-
| Snippet | Purpose |
36-
| ------------ | ----------------------------------------------------- |
37-
| `vbase` | Single file component base with SCSS |
38-
| `vbase-3` | Single File component Composition API with SCSS |
39-
| `vbase-css` | Single file component base with CSS |
40-
| `vbase-pcss` | Single file component base with PostCSS |
41-
| `vbase-styl` | Single file component base with Stylus |
42-
| `vbase-ts` | Single file component base with Typescript |
43-
| `vbase-3-ts` | Single File component Composition API with Typescript |
44-
| `vbase-ns` | Single file component with no styles |
45-
| `vbase-sass` | Single file component base with SASS |
46-
| `vbase-less` | Single file component base with LESS |
35+
| Snippet | Purpose |
36+
| ------------------ | ------------------------------------------------------------ |
37+
| `vbase` | Single file component base with SCSS |
38+
| `vbase-3` | Single File component Composition API with SCSS |
39+
| `vbase-3-reactive` | Single File component Composition API with Reactive and SCSS |
40+
| `vbase-css` | Single file component base with CSS |
41+
| `vbase-pcss` | Single file component base with PostCSS |
42+
| `vbase-styl` | Single file component base with Stylus |
43+
| `vbase-ts` | Single file component base with Typescript |
44+
| `vbase-3-ts` | Single File component Composition API with Typescript |
45+
| `vbase-ns` | Single file component with no styles |
46+
| `vbase-sass` | Single file component base with SASS |
47+
| `vbase-less` | Single file component base with LESS |
4748

4849
### Template
4950

snippets/vue-script.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
},
134134
"Vue Import Component Dynamically": {
135135
"prefix": "vimport-dynamic",
136-
"body": ["const ${1:New} = () => import('@/components/${1:New}.vue')"],
136+
"body": ["${1:New} = () => import('@/components/${1:New}.vue')"],
137137
"description": "Import component that should be lazy loaded"
138138
},
139139
"Vue MapState": {

snippets/vue.json

+31
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,37 @@
190190
],
191191
"description": "Base for Vue File Composition API with SCSS"
192192
},
193+
"Vue Single File Component Composition API Reactive": {
194+
"prefix": "vbase-3-reactive",
195+
"body": [
196+
"<template>",
197+
"\t<div>",
198+
"",
199+
"\t</div>",
200+
"</template>",
201+
"",
202+
"<script>",
203+
"import { reactive, toRefs } from '@vue/composition-api'",
204+
"",
205+
"export default {",
206+
"\tsetup () {",
207+
"\t\tconst state = reactive({",
208+
"\t\t\t${0:count}: ${1:0},",
209+
"\t\t})",
210+
"\t",
211+
"\t\treturn {",
212+
"\t\t\t...toRefs(state),",
213+
"\t\t}",
214+
"\t}",
215+
"}",
216+
"</script>",
217+
"",
218+
"<style lang=\"scss\" scoped>",
219+
"",
220+
"</style>"
221+
],
222+
"description": "Base for Vue File Composition API with SCSS"
223+
},
193224
"Vue Single File Component Composition API with Typescript": {
194225
"prefix": "vbase-3-ts",
195226
"body": [

0 commit comments

Comments
 (0)