An Introduction VueJS 2: What is Vuejs
An Introduction: What is Vuejs
Vuejs is a library used for creating Reactive components of Modern web interfaces. What Reactive components mean its means Vuejs is a framework to make your web applications more reactive to control parts of your dom (Document object Model) to dynamically update to listen and react to user events to bring a mobile app feeling to a web application, so making an app reactive is very first important take away. You can think Vuejs js as a kind of replacement for JQUERY, Vuejs fixes many of the flaws that jquery have.Vue js is mostly used to create single page applications. In order to get started with Vue js please visit the official page of VUE Js (https://vuejs.org/) and click on Get Started Button
Installing VUE JS 2
There are different options available to install VUE JS.It depends on how you may install it by simply importing script and get started with a lighter way or setting a more complex workflow using web pack.The importing script is easiest and quickest way to get started with Vue.
In this post, we will see How to install Vuejs by importing script.
Below are steps to install and use Vue js by simply importing the VueJs script.
Downloading Vue Js
Goto https://vuejs.org/v2/guide/installation.html and download the latest version of Vue js by clicking on https://unpkg.com/vue link under CDN.
Adding or importing Vuejs to your application.
Add a <script> tag in the head section of your webpage and import the downloaded script in that.
Initiating the VueJs Framework
You can initiate a VueJs obj by a new keyword followed by Vue() object which is provided to us because we have imported the Vuejs script.
You have noticed that we have not stored this view instance to any variable because we are not interacting with its instance itself but it still gets created because we have used the new keyword.Right now this Vue instance is not doing anything, we have to pass an object in that in order to configure and use it.
In this object, we have a lot of different properties and methods we can use.This Vue instance is the core of our Vue JS application. In above example, our Vuejs obj has two properties first is el and second is data.In view, js “el” property is used to identify the element which needs to control by Vue. The second property is “data” is used to passing data from Vue js to Html.