What is Vue.js ?
Vue.js is created by Evan You, an ex-employee from Google. The first version of Vue.js was released in Feb 2014.
Why Vue.js ?
Following are the advantages of using Vue.js technology in web development:
2. Easy to Understand and Develop Applications: The user can easily add Vue.js to his web project because of its simple structure. Both the small as well as large scales templates can be developed through this framework which saves a lot of time.
Installation of Vue.js
The installation for Vue.js is very easy to start with. Any developer can easily understand and build interactive web interfaces.
There are many ways to install VueJS:
1) Using the <script> tag directly in HTML file
To download vue.js go to the site https://vuejs.org/v2/guide/installation.html of VueJS and download the vue.js as per your need.
There are two versions for use - production version and development version. The development version is not minimized, whereas the production version is minimized as shown in the following screenshot. Development version will help with the warnings and debug mode during the development of the project.
2. Using CDN
We can also start using VueJS file from the CDN library. This link https://unpkg.com/vue will give the latest version of VueJS.
VueJS is also available on jsDelivr (https://cdn.jsdelivr.net/npm/vue/dist/vue.js) and cdnjs (https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.0/vue.js).
We can host the files at our end, if required and get started with VueJS development.
3. Using NPM
For large scale applications with VueJS, it is recommended to install using the npm package. It comes with Browserify and Webpack along with other necessary tools, which help with the development. Following is the command to install using npm:
npm install vue
4. Using CLI (Command Line Interface)
VueJS also provides CLI to install the vue and get started with the server activation. To install using CLI, we need to have CLI installed which is done using the following command:
npm install --global vue-cli
It takes a few minutes for the installation. Once done, it shows the CLI version for VueJS.
Now, we have to create the project using Webpack. Following is the command to create the project using Webpack:
vue init webpack myproject
Now to get started, we have to use the following command:
cd myproject npm install npm run dev
Once we execute npm run dev, it starts the server and provides the url for display to be seen in the browser which is as shown in the following image.
If you have any queries regarding this blog or need any help you can contact us on: firstname.lastname@example.org