Created
July 11, 2019 03:03
-
-
Save morsecodemedia/eaeeb3e74b55fbd1e23cac24ec8274f0 to your computer and use it in GitHub Desktop.
A VS Code Snippet for a Nuxt.js SFC Boilerplate
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
{ | |
"Nuxt SFC Boilerplate": { | |
"prefix": "nsfc", | |
"body": [ | |
"<template>", | |
"<div>", | |
"<!-- Because you need a single node in template -->", | |
"</div>", | |
"</template>", | |
"<script>", | |
"export default {", | |
"name: 'ComponentNameOfChoice',", | |
"components: {},", | |
"props: {", | |
"propNameOfChoice: {", | |
"type: Object,", | |
"required: true,", | |
"twoWay: true,", | |
"default: () => {}", | |
"}", | |
"},", | |
"data() {", | |
"return {", | |
"message: 'Hello World!'", | |
"}", | |
"},", | |
"watch: {", | |
"watchFunctionNameOfChoice: function (newSlide, oldSlide) {", | |
"console.log('watcher watchFunctionNameOfChoice')", | |
"}", | |
"},", | |
"computed: {", | |
"computedFunctionNameOfChoice() {", | |
"console.log('computed computedFunctionNameOfChoice')", | |
"}", | |
"},", | |
"methods: {", | |
"methodsFunctionNameOfChoice: function() {", | |
"console.log('methods methodsFunctionNameOfChoice ... redundant much?')", | |
"}", | |
"},", | |
"beforeCreate: function() {", | |
"console.log('befreCreate')", | |
"},", | |
"created: function() {", | |
"console.log('created')", | |
"},", | |
"beforeMount: function() {", | |
"console.log('beforeMount')", | |
"},", | |
"mounted: function() {", | |
"console.log('mounted')", | |
"},", | |
"beforeUpdate: function() {", | |
"console.log('beforeUpdate')", | |
"},", | |
"updated: function() {", | |
"console.log('updated')", | |
"},", | |
"beforeDestroy: function() {", | |
"console.log('beforeDestroy')", | |
"},", | |
"destroyed: function() {", | |
"console.log('destroyed')", | |
"}", | |
"}", | |
"</script>", | |
"<style lang='scss' scoped>", | |
"</style>" | |
], | |
"description": "Creates a SFC boilerplate for Nuxt that includes all lifecycle hooks and other misc things." | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment