It was created by an ex-employee from Google named Evan You in Feb 2014.
Vue.js is an approachable, versatile and performant framework that helps to create maintainable and testable codebase.
Performance optimization in Vue.js is not dependent on the developers due to DSL (Domain-Specific Language) which allows getting more done with less code (e.g. v-on modifiers).
Components can be categorized into two major parts at a higher level:
- Presentational Components, and
- Logical Components.
Presentational components use templates and logical components use JSX. Though the percentage depends on the app, generally presentational are more common.
Following are the features available with Vue.js:
With the help of binding directive, v-bind HTML attributes can be manipulated and style can be changed.
It provides the concept of splitting the page into reusable components each having its own HTML, CSS, and js.
The DOM elements are provided with attribute v-on to listen to the events.
It has an inbuilt transition component to provide the transition effect to the element. We can also add external animation libraries to provide more interactivity to the interface.
Vue.js listens to the changes made to the UI elements without any overhead of coding.
Vue.js bind the DOM with the instance data by using HTML-based templates.
Vue.js has built-in directives to perform various actions on the frontend. Eg. v-if, v-else, v-model, v-on, v-bind, v-show etc.
Watchers are attached to the data that keeps changing which makes the code fast.
Vue-router is used to navigate between the pages.
Vue.js can be installed, build and compiled at the command line using the dedicated command line interface vue-cli.
Vue.js vs React
Both Vue.js v/s React uses virtual DOM which makes it faster.
Template v/s JSX
React uses create react app and need web pack for the build whereas Vue.js uses vue-cli /CDN/npm without any requirement of web pack build.
The big name, Facebook behind React i.e. which makes it more popular than Vue.js.
Vue.js vs Angular
Vue.js and Angular have a lot of similarities such as directives v-if and ngIf, v-for and ngFor.
Vue.js is very easy to learn but for Angular, one should be comfortable with typescript first. Also, Angular installation is a bit tacky process.
At present, Angular is used by several organizations making it more popular than Vue.js.
Angular has a lot of inbuilt features but Vue.js needs to depend on third-party libraries.
Vue.js is good with backward compatibility but Angular versions don’t support it due to the core differences.
Angular uses angular-cli, so as Vue.js with vue-cli
Framework, library for Vue.js:
Vue.js can be used to build SPA’s but as the size increases, it becomes tedious to manage the state of components and communication between them. Then there comes Vuex which works as a centralized state management in the application.
Vuex is a library which is more like a state management pattern based on Flux architecture. Flux architecture is used by Facebook for client-side web applications. The object created in Vuex is termed as a store.
It is a higher-level framework that enables us to generate static website pages which are good for SEO and extremely fast. The main scope is UI rendering without letting know about the client and server code distribution. Nuxt.js comes with features like Asynchronous Data, Middleware, Layouts, etc. It configures libraries needed for developing aVue.js application. It uses Webpack along-with loaders to bundle, split and minify the code.
It is an another progressive, reusable semantic component framework. It aims to provide semantic and reusable components forVue.js. With the help of either npm or yarn one can include Vuetify by pulling it in node_modules into an existing project.
Vue.js is very flexible and simpler both in terms of design and API. The modular approach of Vue.js makes it adaptable to a wide range of projects, while also providing the advanced features such as linting, hot module reloading, CSS extraction etc. It makes data flow easier by enforcing a one-way data flow between components It is much easier to optimize as it doesn’t involve dirty checking. In a smaller-scale app, typescript may lower the productivity due to unnecessary overhead which can be overcome by Vue.js. Though Vue.js is comparatively new but is already being used in various large-scale projects eg. Alibaba, Baidu, Xiaomi, and Tencent.
Vue.js has take the position in the market and can be a good competitor for Angular and React.