-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Original snippets #3 - vref - vreactive - vcomputed - vwatch - vwatcheffect - vonmounted - vonbeforemount - vonbeforeupdate - vonupdated - vonerrorcaptured - vonunmounted - vonbeforeunmount * New snippets #3 - vdefineprops - vdefineemits - vdefineemits-nopayload - vsingleemit - vsingleemit-nopayload
- Loading branch information
Showing
2 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{ | ||
"Vue Ref": { | ||
"prefix": "vref", | ||
"body": ["const ${1:name} = ref(${2:initialValue})"], | ||
"description": "Vue Ref" | ||
}, | ||
"Vue Reactive": { | ||
"prefix": "vreactive", | ||
"body": ["const ${1:name} = reactive({", "\t${2:count}: ${3:0}", "})"], | ||
"description": "Vue reactive" | ||
}, | ||
"Vue Computed": { | ||
"prefix": "vcomputed", | ||
"body": ["const ${1:name} = computed(() => {", "\treturn ${2}", "})"], | ||
"description": "Vue computed" | ||
}, | ||
"Vue Watch": { | ||
"prefix": "vwatch", | ||
"body": [ | ||
"watch(", | ||
"\t() => ${1:name},", | ||
"\t() => {", | ||
"\t\t${2}", | ||
"\t}", | ||
")" | ||
], | ||
"description": "Vue watcher" | ||
}, | ||
"Vue Watch Effect": { | ||
"prefix": "vwatcheffect", | ||
"body": [ | ||
"watchEffect(() => {", | ||
"\t${1}", | ||
"})" | ||
], | ||
"description": "Vue Watch Effect" | ||
}, | ||
"Vue Lifecycle Hooks - onMounted": { | ||
"prefix": "vonmounted", | ||
"body": [ | ||
"onMounted(() => {", | ||
"\t${1}", | ||
"})" | ||
], | ||
"description": "Vue onMounted Lifecycle hook" | ||
}, | ||
"Vue Lifecycle Hooks - onBeforeMount": { | ||
"prefix": "vonbeforemount", | ||
"body": [ | ||
"onBeforeMount(() => {", | ||
"\t${1}", | ||
"})" | ||
], | ||
"description": "Vue onBeforeMount Lifecycle hook" | ||
}, | ||
"Vue Lifecycle Hooks - onBeforeUpdate": { | ||
"prefix": "vonbeforeupdate", | ||
"body": [ | ||
"onBeforeUpdate(() => {", | ||
"\t${1}", | ||
"})" | ||
], | ||
"description": "Vue onBeforeUpdate Lifecycle hook" | ||
}, | ||
"Vue Lifecycle Hooks - onUpdated": { | ||
"prefix": "vonupdated", | ||
"body": [ | ||
"onUpdated(() => {", | ||
"\t${1}", | ||
"})" | ||
], | ||
"description": "Vue onUpdated Lifecycle hook" | ||
}, | ||
"Vue Lifecycle Hooks - onErrorCaptured": { | ||
"prefix": "vonerrorcaptured", | ||
"body": [ | ||
"onErrorCaptured(() => {", | ||
"\t${1}", | ||
"})" | ||
], | ||
"description": "Vue onErrorCaptured Lifecycle hook" | ||
}, | ||
"Vue Lifecycle Hooks - onUnmounted": { | ||
"prefix": "vonunmounted", | ||
"body": [ | ||
"onUnmounted(() => {", | ||
"\t${1}", | ||
"})" | ||
], | ||
"description": "Vue onUnmounted Lifecycle hook" | ||
}, | ||
"Vue Lifecycle Hooks - onBeforeUnmount": { | ||
"prefix": "vonbeforeunmount", | ||
"body": [ | ||
"onBeforeUnmount(() => {", | ||
"\t${1}", | ||
"})" | ||
], | ||
"description": "Vue onBeforeUnmount Lifecycle hook" | ||
}, | ||
"Vue Define Props": { | ||
"prefix": "vdefineprops", | ||
"body": [ | ||
"defineProps<{", | ||
"\t${1:name}: ${2:type}", | ||
"}>()" | ||
], | ||
"description": "Vue defineProps" | ||
}, | ||
"Vue Define Emits": { | ||
"prefix": "vdefineemits", | ||
"body": [ | ||
"defineEmits<{", | ||
"\t(e: '${1:eventName}', ${2:payloadName}: ${3:payloadType}): void", | ||
"}>()" | ||
], | ||
"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", | ||
], | ||
"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" | ||
}, | ||
} |