Skip to content

Instantly share code, notes, and snippets.

@vedovelli
Created April 2, 2020 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vedovelli/066b73e85fb3ed15165f8faca08b3489 to your computer and use it in GitHub Desktop.
Save vedovelli/066b73e85fb3ed15165f8faca08b3489 to your computer and use it in GitHub Desktop.
{
"Vue Simple Component": {
"scope": "vue",
"prefix": "vsc",
"body": [
"<script>",
"export default {",
" name: '$1',",
"};",
"</script>",
"",
"<template>",
" <div>$2</div>",
"</template>",
""
],
"description": "Vue simple component"
},
"Vue Component": {
"scope": "vue",
"prefix": "vc",
"body": [
"<script>",
"import { mapGetters, mapState, mapActions } from 'vuex';",
"",
"const computed = {",
" ...mapState('$1', ['$2']),",
" ...mapGetters('$1', ['$3']),",
"};",
"",
"const actions = mapActions('$1', ['$4']);",
"",
"export default {",
" computed,",
" methods: {",
" ...actions,",
" },",
"};",
"</script>",
"",
"<template>",
" <div>$5</div>",
"</template>",
""
],
"description": "Vue complete component"
},
"Comment": {
"scope": "javascript, typescript",
"prefix": "cm",
"body": ["/*", "* $1", "*/"],
"description": "Comment"
},
"Console.log": {
"scope": "javascript, typescript",
"prefix": "wcl",
"body": ["// eslint-disable-next-line", "console.log($1);"],
"description": "Console.log"
},
"Jest describe()": {
"prefix": "des",
"body": ["describe('$1', () => {", "$2})"],
"description": "Jest describe block"
},
"Jest it()": {
"prefix": "it",
"body": ["it('$1', () => {", " $2", "});"],
"description": "Jest it block"
},
"Arrow function": {
"scope": "javascript, typescript",
"prefix": "arr",
"body": ["$1 => $2"],
"description": "Arrow function"
},
"Async Arrow function": {
"scope": "javascript, typescript",
"prefix": "aarr",
"body": ["async $1 => $2"],
"description": "Async Arrow function"
},
"Javascript default import": {
"scope": "javascript, typescript",
"prefix": "di",
"body": ["import $1 from '$1';"],
"description": "Javascript default import"
},
"Javascript named import": {
"scope": "javascript, typescript",
"prefix": "ni",
"body": ["import { $2 } from '$1';"],
"description": "Javascript named import"
},
"ESLint disable next line": {
"scope": "javascript, typescript",
"prefix": "dis",
"body": ["// eslint-disable-next-line"],
"description": "ESLint disable next line"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment