This chapter covers
- A quick intro to the Vue.js framework
- How to jumpstart a new project with Vue CLI
- How to work with class-based components
- How to arrange client-side navigation using the Vue Router
Angular is a framework, React.js is a library, and Vue.js (a.k.a. Vue) feels like a “library plus plus.” Vue (https://vuejs.org) was created by Evan You in 2014 as an attempt to create a lighter version of Angular. At the time of this writing, Vue.js has 155,000 stars and 285 contributors on GitHub. The numbers are high, but Vue is not backed by any large corporation like Angular (Google) or React.js (Facebook).
Vue is a progressive, incrementally adoptable JavaScript framework for building UIs on the web, so if you already have a web app written with or without any JavaScript libraries, you can introduce Vue to just a small portion of your app and keep adding Vue to other parts of the app as needed. Much like React, you can attach a Vue instance to any HTML element (such as a <div>), and only this element will be controlled by Vue.
Vue is a component-based library that’s focused on the app’s View part (the V in the MVC pattern). The core Vue library focuses on declarative rendering of UI components, and like React.js, Vue uses the Virtual DOM under the hood. Besides the code library, Vue comes with other modules for client-side routing, state management, and so on.