Skip to content

feat: Update defineEmits to Vue 3.3 syntax #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ These snippets were made to speed up Vue 3 development. With it you can write bo
| `vonbeforeunmount` | onBeforeUnmount hook |
| `vdefineprops` | Define props |
| `vdefineemits` | Define emits |
| `vdefineemits-nopayload` | Define emits with no payload |
| `vsingleemit` | Single emit for defineEmits |
| `vsingleemit-nopayload` | Single emit for defineEmits with no payload |

### CSS

Expand Down
20 changes: 2 additions & 18 deletions snippets/vue/vue-script.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -111,32 +111,16 @@
"prefix": "vdefineemits",
"body": [
"defineEmits<{",
"\t(e: '${1:eventName}', ${2:payloadName}: ${3:payloadType}): void",
"\t${1:eventName}: [${2}]",
"}>()"
],
"description": "Vue defineEmits"
},
"Vue Define Emits - No Payload": {
"prefix": "vdefineemits-nopayload",
"body": [
"defineEmits<{",
"\t(e: '${1:eventName}'): void",
"}>()"
],
"description": "Vue defineEmits with no payload"
},
"Vue Single Emit": {
"prefix": "vsingleemit",
"body": [
"(e: '${1:eventName}', ${2:payloadName}: ${3:payloadType}): void",
"${1:eventName}: [${2}]",
],
"description": "Vue single emit for defineEmits"
},
"Vue Single Emit - No Payload": {
"prefix": "vsingleemit-nopayload",
"body": [
"(e: '${1:eventName}'): void",
],
"description": "Vue single emit for defineEmits with no payload"
},
}