- In a vue component, you write your content into the
template, add css to the styles, and declare your data, props, methods, etc into the script tag. You will also import other files into the script tag
- Your vue components should be capitalized.
components/Header.vue
- but your layouts should be lowercase
layouts/default.vue
- This is an example of how a vue file is set up
<template>
<!-- HTML, compononents, vue directives here -->
</template>
<style>
/* This is optional */
</style>
<script>
// import modules etc here
export default ({
el: '#app',
props: {
property: type
// You can use arrays and objects here
},
data: {
}
})
</script>