Vue Components
up:: Vue
Components are essentially just ‘mini-apps’. You can have all the goodness of Vue Methods, Vue Data Binding and so on.
Naming convention: multi-words
. At least two words, separated by a hyphen.
Global components
- Create a file in
components/
app.component('kebab-name', 'ImportName')
in main.js- Use component wherever
Local components
Both PascalCase and kebab-case work for imports. With PascalCase, you can use self-closing tags (<PascalCase />
).