Skip to content

Instantly share code, notes, and snippets.

@romainavalle
Last active September 12, 2022 14:59
Show Gist options
  • Save romainavalle/fec1d4d1005249b3ab35763ca9f847a1 to your computer and use it in GitHub Desktop.
Save romainavalle/fec1d4d1005249b3ab35763ca9f847a1 to your computer and use it in GitHub Desktop.
scaffold snippet for .vue files
{
// Place your snippets for vue 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": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Scaffold Vue components": {
"prefix": "scaffold",
"body": [
"<template>",
" <${2:div} class=\"${1:className}\"></${2:div}>",
"</template>",
"<script>",
"export default {",
" name: \"${1/(.*)/${1:/pascalcase}/}\",",
" data() {",
" return {}",
" },",
" props:{},",
" mounted() {",
" }",
"},",
" methods: {}",
"</script>",
"<style lang=\"scss\" >",
" .$1{}",
"</style>",
],
"description": "scaffold component"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment