Created
July 26, 2018 01:20
-
-
Save KarllosSouza/af1684ea049ad244336800b686a405d0 to your computer and use it in GitHub Desktop.
Vue Component Structure
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
<template lang="html"> | |
<div class="sample-class"> | |
<!-- ... --> | |
</div> | |
</template> | |
<script type="text/javascript"> | |
export default { | |
// Don't forget | |
name: 'SampleComponent', | |
// Share common functionalities with mixins | |
mixins: [], | |
// Compose new components | |
extends: {}, | |
// Properties/Variables | |
props: { | |
bar: {}, // Alphabetized | |
foo: {}, | |
fooBar: {}, | |
}, | |
// Variables | |
data() {}, | |
computed: {}, | |
// Other components used | |
components: {}, | |
// Methods | |
watch: {}, | |
methods: {}, | |
// Lifecycle hooks | |
beforeCreate() {}, | |
mounted() {}, | |
}; | |
</script> | |
<style lang="sass" scoped> | |
.sample-class { | |
/* ... */ | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment