Vue.js — Considerations and Tricks

1. Why Vue.js doesn’t use ES classes out-of-box for component?

If you are coming from Angular-like framework or some backend OOP heavy language, your first question will be — why not classes for components?

There are three main reason why not classes as default mechanism:

ES Classes are not good enough to meet the needs of Vue.js current API. ES Classes are not fully evolved and often criticized as a step in the wrong direction. Classes with private fields and decorators once stabilized (Stage 3 at least) may help. ES Classes serve good only those who are familiar with Class-based languages. It easily excludes large community of web that doesn’t use sophisticated build tools or transpilers.

Building great UI component hierarchy is about great component composition. It is not about great inheritance hierarchy. Unfortunately, ES classes are better at the latter.

To read this brilliant piece of writing, visit- blog.webf.zone

(Disclaimer: This post was originally published on Medium by Harshal Patil and has been reproduced with permission. Monjin is not responsible or liable for any content in this article.)

Leave a Reply

Your email address will not be published. Required fields are marked *