VueJS 2 Hello World Example Script

Vue.JS Tutorial

In this tutorial, we will simply perform the hello world Example using VueJS or you can say we are going to create our first VueJS application.

The VueJS framework returns only the Vue object. So, to start Vue JS you need to create a Vue instance, and the instance takes an object as an argument or parameter, and the object has many Properties & Methods to control a specific element.

var myApp = new Vue({
    // Properties and Methods

After creating a Vue instance, to control a particular element first you need to select the element which you want to control.

To select an element we will use the el: Property –

// Target element
<div id="myApp"></div>

// Including VueJS
<script src=""></script>

//Creating the Vue instance & Selecting the div element whose id is myApp.
    var myApp = new Vue({

You can create multiple Vue instances in one project, but each instance is only able to control its own element.

Vue JS multiple Instance

VueJS Hello World Example

To store dynamic data inside a Vue instance we will use the data: property and it is an object, and then we will use the double curly brackets {{}} to show the value of the data.

<div id="myApp">
  <h1>{{ myMessage }}</h1>
  <p>{{ subHeading }}</p>

<script src=""></script>
var myApp = new Vue({
      myMessage: 'Hello World!',
      subHeading: '-- Welcome to VueJS --'

You May Also Like

Leave a Comment

Your email address will not be published. Required fields are marked *