Skip to content

Commit 8beafa4

Browse files
authored
feat(vue): Add Suspense vue-html snippet (#71)
This snippet provides a quick and convenient way to insert a Suspense component in Vue 3, with a fallback template.
1 parent a20beae commit 8beafa4

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

README.md

+17-16
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,23 @@ These snippets were made to speed up Vue 3 development. With it you can write bo
4444

4545
### Template
4646

47-
| Snippet | Purpose |
48-
| -------------- | --------------------------------- |
49-
| `vfor` | `v-for` statement |
50-
| `vmodel` | `v-model` directive |
51-
| `von` | `v-on` click handler |
52-
| `vel-props` | Component element with `props` |
53-
| `vslot-named` | Named slot |
54-
| `vimg` | Image source binding |
55-
| `vstyle` | Inline style binding |
56-
| `vstyle-obj` | Inline style binding with objects |
57-
| `vclass` | Class binding |
58-
| `vclass-ter` | Ternary class binding |
59-
| `vtrans` | Transition component |
60-
| `vtrans-group` | Transition group component |
61-
| `vrlink` | Router link |
62-
| `vrlink-param` | Router link with param |
47+
| Snippet | Purpose |
48+
| -------------- | -------------------------------------- |
49+
| `vfor` | `v-for` statement |
50+
| `vmodel` | `v-model` directive |
51+
| `von` | `v-on` click handler |
52+
| `vel-props` | Component element with `props` |
53+
| `vslot-named` | Named slot |
54+
| `vimg` | Image source binding |
55+
| `vstyle` | Inline style binding |
56+
| `vstyle-obj` | Inline style binding with objects |
57+
| `vclass` | Class binding |
58+
| `vclass-ter` | Ternary class binding |
59+
| `vtrans` | Transition component |
60+
| `vtrans-group` | Transition group component |
61+
| `vrlink` | Router link |
62+
| `vrlink-param` | Router link with param |
63+
| `vsuspense` | Suspense wrapper with fallback content |
6364

6465
### Script
6566

snippets/vue/vue-template.code-snippets

+11
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,15 @@
8989
],
9090
"description": "vue router link with param"
9191
},
92+
"Vue Suspense Wrapper": {
93+
"prefix": "vsuspense",
94+
"body": [
95+
"<Suspense>",
96+
" <template #fallback>",
97+
" ${1:Loading...}",
98+
" </template>",
99+
"</Suspense>"
100+
],
101+
"description": "Vue 3 Suspense component with fallback template"
102+
}
92103
}

0 commit comments

Comments
 (0)