Full-Stack Web Development with Vue.js and Node

(singke) #1
Building the Real Application Chapter 5

Vue.js is progressive. With Vue.js, you can start with small and then progress gradually
toward building bigger applications. This means that if you are just starting out, you might


want to start with a very small application and scale slowly. Vue.js is perfect for such


applications. It is lightweight and flexible as well. The learning curve is also very easy and
super easy to get started.


Vue.js was invented by Evan You. It was first released in February 2014 and gained huge
popularity around 2016. He used to work for Google and in Angular projects. The


motivation for this invention was mainly because he didn't want to use Angular for small


projects, since Angular provides a lot of packages out of the box and, hence, is not
lightweight and not suitable for small applications. Having said that, Vue.js does not only


target the smaller applications. It definitely does not provide all the packages with it, but
you can add them as you progress with your application. That is the beauty of Vue.js.


Installing Vue.js


Let's get started with the installation of Vue.js. There are three ways to install and use


Vue.js.


Including it in a script tag


The easiest way to use Vue.js is to download it and include it in your script tag. You can


download it from https:/​/​cdn.​jsdelivr.​net/​npm/​vue:


<script type="text/javascript" src="vue.js"></script>

Using Content Delivery Network (CDN) links directly


CDN is a network of distributed servers. It stores the cached version of contents in different


geographical locations so that the content loads faster when fetched. We can use the CDN


link directly in our script tag:


<script type="text/javascript"
src="https://cdn.jsdelivr.net/npm/vue.js"></script>
Free download pdf