Skip to content

Commit fb4cfc7

Browse files
authored
feat: Add Vue 3.3 snippets (#45)
* Fix vitest in readme * Vue 3.3 snippets #41
1 parent 2cd2b15 commit fb4cfc7

File tree

2 files changed

+53
-7
lines changed

2 files changed

+53
-7
lines changed

Diff for: README.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ These snippets were made to speed up Vue 3 development. With it you can write bo
7676
| `vdefineprops` | Define props |
7777
| `vdefineemits` | Define emits |
7878
| `vsingleemit` | Single emit for defineEmits |
79+
| `vdefineslots` | Define slots |
80+
| `vsingleslot` | Single slot for defineSlots |
81+
| `vdefineoptions` | Define Options |
82+
| `vdefinemodel` | Define Model |
7983

8084
### CSS
8185

@@ -171,12 +175,22 @@ These snippets were made to speed up Vue 3 development. With it you can write bo
171175
| `vitest-todo` | Vitest Test - Todo |
172176
| `visnapshot` | Vitest Match Snapshot |
173177
| `visnapshot-inline` | Vitest Match Snapshot - Inline |
174-
| `vimount` | Vue Test Utils `mount` |
175-
| `vicomponent` | Vue Test Utils Component |
176-
| `vimount-suspended` | nuxt-vitest `mountSuspended` |
177-
| `vimocknuxtimport` | nuxt-vitest `mockNuxtImport` |
178-
| `vimockcomponent` | nuxt-vitest `mockComponent` |
179-
| `viregisterendpoint` | nuxt-vitest `registerEndpoint` |
178+
179+
### Vitest Vue
180+
181+
| Snippet | Purpose |
182+
| ------------- | ------------------------ |
183+
| `vimount` | Vue Test Utils `mount` |
184+
| `vicomponent` | Vue Test Utils Component |
185+
186+
### Vitest Nuxt
187+
188+
| Snippet | Purpose |
189+
| -------------------- | ------------------------------ |
190+
| `vimount-suspended` | nuxt-vitest `mountSuspended` |
191+
| `vimocknuxtimport` | nuxt-vitest `mockNuxtImport` |
192+
| `vimockcomponent` | nuxt-vitest `mockComponent` |
193+
| `viregisterendpoint` | nuxt-vitest `registerEndpoint` |
180194

181195
## Contributing
182196

Diff for: snippets/vue/vue-script.code-snippets

+33-1
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,36 @@
123123
],
124124
"description": "Vue single emit for defineEmits"
125125
},
126-
}
126+
"Vue Define Slots": {
127+
"prefix": "vdefineslots",
128+
"body": [
129+
"defineSlots<{",
130+
"\tdefault: (props: { ${0} }) => any",
131+
"}>()"
132+
],
133+
"description": "Vue defineSlots"
134+
},
135+
"Vue Single Slot": {
136+
"prefix": "vsingleslot",
137+
"body": [
138+
"\t${1:slotName}: (props: { ${0} }) => any",
139+
],
140+
"description": "Vue single slot for defineSlots"
141+
},
142+
"Vue Define Options": {
143+
"prefix": "vdefineoptions",
144+
"body": [
145+
"defineOptions({",
146+
"\t${0}",
147+
"})"
148+
],
149+
"description": "Vue defineOptions"
150+
},
151+
"Vue Define Model": {
152+
"prefix": "vdefinemodel",
153+
"body": [
154+
"const modelValue = defineModel()",
155+
],
156+
"description": "Vue defineModel"
157+
},
158+
}

0 commit comments

Comments
 (0)