March 2018
Beginner to intermediate
344 pages
7h 7m
English
It's not a good idea to name components in single words as it has the chance to conflict with native HTML elements. Let's say we had a signup form and a component named Form.vue; what would be an appropriate name when using this inside our template?
Well, as you might imagine, having a component named <form> will conflict with the <form>, so it's a best practice to have components that are named with more than one word. A better example can be the name of signup-form, app-signup-form, or app-form, depending on preference:
// This would not be an appropriate name as it conflicts with HTML elements.Vue.component('form', Form)// This is a better name as it's multi-word and there are less chances to conflict. ...Read now
Unlock full access