Category: Basic

Computed Property in Vue.js

What is computed property? This can be considered as property of the data object or methods you can access them as if they were properties of the data object, but you define them as functions. Property of the data object

Why do you need computed property? The computed properties are cached and when you […]

Read more

Binding to Class attribute in Vue.js

There are several ways you can bind to CSS class. We will see them one by one Object Syntax You can bind css class using {}. You just to put the name of the css class.

If IsActive is true it will apply the redbox CSS class to Div element

Read more

Binding to Style attribute in Vue.js

I have the following Div element and I am going to change the font size using data object

This is the Vue instance and you have the font_size data object

We will see another style binding example where you can create data object and assign it to the style attribute

You […]

Read more

Data Binding in Vue.js

We will see how to do data binding in Vue.js You can not use {{ }} with HTML attributes For example, following syntax is not going to work

Insted you can use

This is another syntax to achive same result

This is the compled code for above example

Read more

Create your first project in Vue.js

In this tutorial, I am going to create the Hello World project with Vue.js You can create the HTML file and add the following code to run your first Vue.js project

In line 5, You can see the script tag with Vue library which is used to make Vue component work. {{msg}} => We […]

Read more