Skip to content

Instantly share code, notes, and snippets.

@KarllosSouza
Created July 26, 2018 01:20
Show Gist options
  • Save KarllosSouza/af1684ea049ad244336800b686a405d0 to your computer and use it in GitHub Desktop.
Save KarllosSouza/af1684ea049ad244336800b686a405d0 to your computer and use it in GitHub Desktop.
Vue Component Structure
<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