Skip to content

Instantly share code, notes, and snippets.

@yudikubota
Created March 15, 2023 14:58
Show Gist options
  • Save yudikubota/627698e48595675250e2fe8b84d96637 to your computer and use it in GitHub Desktop.
Save yudikubota/627698e48595675250e2fe8b84d96637 to your computer and use it in GitHub Desktop.
My VS Code javascript snippets
{
// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "cl",
"body": [
"console.log('$1')$2"
],
"description": "Log output to console"
},
"Print variable to console": {
"prefix": "clv",
"body": [
"console.log('$1', $1)$2"
],
"description": "Log variable to console"
},
"Start logging time": {
"prefix": "ct",
"body": [
"console.time('$1')$2"
],
"description": "Start counting time"
},
"End logging time": {
"prefix": "cte",
"body": [
"console.timeEnd('$1')$2"
],
"description": "Log elapsed time to console"
},
"Start console group": {
"prefix": "cg",
"body": [
"console.group('$1')$2"
],
"description": "Start console group"
},
"End console group": {
"prefix": "cge",
"body": [
"console.group('$1')$2"
],
"description": "End console group"
},
"Vue data": {
"prefix": "vue:data",
"body": [
"data: vm => ({",
" $1: $2,",
"}),",
],
"description": "Vue data vm"
},
"Vue props": {
"prefix": "vue:props",
"body": [
"props: {",
" $1: $2,",
"},",
],
"description": "Vue props"
},
"Vue methods": {
"prefix": "vue:methods",
"body": [
"methods: {",
" $1($2) {",
" $3",
" },",
"},",
],
"description": "Vue methods"
},
"Vue computed": {
"prefix": "vue:computed",
"body": [
"computed: {",
" $1() {",
" return $2",
" },",
"},",
],
"description": "Vue computed"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment