I have four components: comments.vue
, comments-list.vue
, comment.vue
, comment-new.vue
.
comments.vue
uses other components to display:
List of comments (does not have any ajax calls)
a. Which contains single comment (basically it's just a template with single property)
Textarea to send comment (has ajax calls)
comments.vue
has all logic to load paginated comments
So my question is: is it good separation of responsibilities?
You can check this Vue.js Component Style Guide
From the guide:
Vue Component Names
Each component name must be:
Vue component names must also be:
Why?
The name is used to communicate about the component. So it must be short, meaningful and pronounceable.
How?
<!-- recommended -->
<app-header></app-header>
<user-list></user-list>
<range-slider></range-slider>
<!-- avoid -->
<btn-group></btn-group> <!-- short, but unpronounceable. use `button-group` instead -->
<ui-slider></ui-slider> <!-- all components are ui elements, so is meaningless -->
<slider></slider> <!-- not custom element spec compliant -->
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With