Skip to content

Commit c7b3500

Browse files
authored
feat: Add ref with generic type argument (#59)
* feat: ✨ ADD ref with generic type argument * feat: Add `withDefaults` snippet for `defineProps` (#58) * feat: ✨ ADD withDefaults for defineProps * refactor: ✏️ RENAME prefix * feat: ✨ ADD ref with generic type argument
1 parent 03dfc44 commit c7b3500

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ These snippets were made to speed up Vue 3 development. With it you can write bo
6666
| Snippet | Purpose |
6767
| -------------------------- | --------------------------- |
6868
| `vref` | Vue `ref` |
69+
| `vref-typed` | Vue `ref` with generic type argument |
6970
| `vreactive` | Vue `reactive` |
7071
| `vcomputed` | Vue `computed` |
7172
| `vwatch` | Watcher |

snippets/vue/vue-script.code-snippets

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
"body": ["const ${1:name} = ref(${2:initialValue})"],
55
"description": "Vue Ref"
66
},
7+
"Vue Ref typed": {
8+
"prefix": "vref-typed",
9+
"body": ["const ${1:name} = ref<${2:type}>(${3:initialValue})"],
10+
"description": "Vue Ref with generic type argument"
11+
},
712
"Vue Reactive": {
813
"prefix": "vreactive",
914
"body": ["const ${1:name} = reactive({", "\t${2:count}: ${3:0}", "})"],

0 commit comments

Comments
 (0)