Skip to content

Commit 1743ace

Browse files
committed
🚚 Move emit snippets from script to template
1 parent ba5c565 commit 1743ace

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set
6868
| `vroutename` | router-link Named Routing |
6969
| `vroutenameparam` | router-link Named with Parameters |
7070
| `vroutepath` | router-link Path Routing Link |
71+
| `vemit-child` | Emit event from child component |
72+
| `vemit-parent` | Emit event to parent component |
7173

7274
### Script
7375

@@ -86,8 +88,6 @@ You can enable tab completion (recommended) by opening `Code > Preferences > Set
8688
| `vbeforedestroy` | beforeDestroy lifecycle method |
8789
| `vdestroyed` | destroyed lifecycle method |
8890
| `vprops` | Props with type and default |
89-
| `vemit-child` | Emit event from child component |
90-
| `vemit-parent` | Emit event tp parent component |
9191
| `vimport` | Import one component into another |
9292
| `vimport-dynamic` | Import one component that should be lazy loaded by webpack |
9393
| `vcomponents` | Import one component into another within the export statement |

snippets/vue-pug.json

+10
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,15 @@
8282
"prefix": "vnuxtl",
8383
"body": ["nuxt-link(to=\"/${1:page}\") ${1:page}"],
8484
"description": "nuxt routing link"
85+
},
86+
"Vue Emit from Child": {
87+
"prefix": "vemit-child",
88+
"body": ["@change=\"$emit('change', $event.target.value)\""],
89+
"description": "Vue Emit from Child Component"
90+
},
91+
"Vue Emit to Parent": {
92+
"prefix": "vemit-parent",
93+
"body": ["@change=\"${1:foo} = $event\""],
94+
"description": "Vue Emit to Parent Component"
8595
}
8696
}

snippets/vue-script.json

-10
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,6 @@
9898
],
9999
"description": "Vue Props with Default"
100100
},
101-
"Vue Emit from Child": {
102-
"prefix": "vemit-child",
103-
"body": ["@change=\"$emit('change', $event.target.value)\""],
104-
"description": "Vue Emit from Child Component"
105-
},
106-
"Vue Emit to Parent": {
107-
"prefix": "vemit-parent",
108-
"body": ["@change=\"${1:foo} = $event\""],
109-
"description": "Vue Emit to Parent Component"
110-
},
111101
"Vue Import File": {
112102
"prefix": "vimport",
113103
"body": ["import ${1:New} from '@/components/${1:New}.vue';"],

snippets/vue-template.json

+10
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,15 @@
112112
"prefix": "vroutepath",
113113
"body": ["<router-link to=\"${1:path}\">${2:LinkTitle}</router-link>"],
114114
"description": "Path routing link"
115+
},
116+
"Vue Emit from Child": {
117+
"prefix": "vemit-child",
118+
"body": ["@change=\"$emit('change', $event.target.value)\""],
119+
"description": "Vue Emit from Child Component"
120+
},
121+
"Vue Emit to Parent": {
122+
"prefix": "vemit-parent",
123+
"body": ["@change=\"${1:foo} = $event\""],
124+
"description": "Vue Emit to Parent Component"
115125
}
116126
}

0 commit comments

Comments
 (0)