[Vuejs]-Naming convention for components which could share the name of an HTML element?

0👍

Prefix might be added for sake of it. But its a good practice as per W3C rules and also stated in Vue docs:

Note that Vue does not enforce the W3C rules for custom tag names (all-lowercase, must contain a hyphen) though following this convention is considered good practice.

This is what I prefer:
If at all your component is application specific, it should have an application specific name.

If its a component which can be used across, the name should be based on its feature. For eg <credit-card></credit-card>

So its a good practice to follow this naming convention and it also helps in differentiating custom elements from the standard ones.

Leave a comment