Vue.js Tutorial
Last Updated :
14 Dec, 2024
Improve
Vue.js is a progressive JavaScript framework for building user interfaces. It stands out for its simplicity, seamless integration with other libraries, and reactive data binding.
- Built on JavaScript for flexible and component-based development.
- Supports declarative rendering, reactivity, and two-way data binding.
- Provides a lightweight framework with powerful features for single-page applications (SPAs).
- Easy integration into existing projects or libraries.
To start with Vue.js, you need to install or set it up on your machine. Follow these articles to install depending on your system:
Let us now take a look at our first code example.
// App.vue
<template>
<div>
<h1>{{ message }}</h1>
</div>
</template>
<script>
export default {
data() {
return {
message: 'Welcome to the Vue.js Tutorial'
};
}
};
</script>
<style>
h1 {
color: #42b983;
text-align: center;
}
</style>
It will start a server, and when you visit http://localhost:8080, it will display
Welcome to the Vue.js Tutorial
In this example:
- The App.vue file defines the structure, logic, and styling of the application in a single file component.
- message is a reactive property defined in the data() function and rendered in the template using {{ }}.
- The application is mounted to the #app div in index.html (automatically generated in the Vue project setup).
Why Learn Vue.js?
- Lightweight and easy to integrate with existing projects.
- Offers excellent performance for small- to medium-sized applications.
- Supports two-way data binding and reactivity.
- Backed by a robust community and extensive documentation.

Vue.js Tutorial Prerequisites: HTML, CSS and JavaScript
Vue.js Basics
- Introduction & Installation
- Instances
- Event Modifiers
- DOM tree
- How to write and use for loop in Vue js ?
- Two Way Binding Model
- Reusing Components
- Rendering
- List Rendering Mutation Methods
- v-cloak Directive
- Passing Data to Child Components with Props
- Form Input Binding with Select option
- Dynamic Components
- Form Input Value Binding
- Form Input Binding number Modifier
- List Rendering v-for with v-if
- List Rendering v-for with a Range
- Form Input Binding with Checkbox option
- Form Input Binding with Multiline text
- Form Input Binding trim Modifier
- Form Input Binding with Radio Option
- List Rendering v-for with an Object
- Render Function with h() Arguments
- Form Input Binding with Radio Option
- List Rendering v-for with an Object
- Composition API with Templates
- Event Handling
- Event Modifiers
- Declarative Rendering
- Create a Hover effect in Vue.js
- Types of data binding with template in Vue.js
- Click Event
- Dynamic Components
- Pass data between components using Vue.js Event Bus
- Passing Data to Child Components with Props
- Render Functions Component VNodes creation
- List Entering & Leaving Transitions
- Composition API using Provide
- Watchers
- Methods
Vue.js Directives
- v-on:keyup Directive
- v-bind Directive in Vue.js
- v-for Directive in Vue.js
- List Rendering v-for with a Range
- v-else-if Directive in Vue.js
- Custom Directives with Components
- Form Input Binding number Modifier
- Conditional Rendering
- List Rendering v-for with a Component
- List Rendering v-for on a <template>
- v-if directive
- v-text directive
- v-show directive
- v-html directive
- v-on:click directive
- v-once Directive
- v-on:click.ctrl Directive
- v-on:click.right Directive
- v-on:click.shift Directive
- v-on:click.left Directive
- v-on:click.middle Directive in Vue.js
- v-pre Directive
Vue.js Transition
Vue.js Routing
Advanced Vue
Differences
- Node.js vs Vue.js
- What is the difference between ShadowDOM and VirtualDOM ?
- What is the difference between created and mounted event in VueJS?
- Comparative study of Svelte vs React vs Angular vs Vue
- What is the difference between one-way data flow and two-way data binding in vue.js?
Miscellaneous
- How to replace all occurrences of a string using Vue.js filters ?
- How to set a click event once a page or view is loaded in vue.js?
- How to check an image is loaded or not in VueJS ?
- How to loop through a list of elements and display it in VueJS ?
- How to Make localStorage Reactive in Vue.js ?
- How to implement DateTime localization in vue.js ?
- Select different values on two select tags in Vue.js
- How to convert a normal string to a uppercase string using filter in VueJS ?
- How to dynamically add or remove items from a list in Vue.js ?
- How to binding inline styles in Vue.js ?
- How to change text into lower case string using filters in Vue.js ?
- How to Add Custom Fonts in VueJS ?
- How to Trigger Watchers on Initialization in Vue.js ?
- How to replace jQuery with Vue.js ?
- How to catch props data on component change in Vue.js ?
- How to create a reporting app with Vue 3 and Composition API ?
- How to delete all occurrences of a particular string using Vue.js ?
- How to Toggle a Class in Vue.js ?
- How to Check Response Data Length in VueJS ?
- Why the component data must be a function in vue.js ?
Vue.js for Interview
Applications of Vue.js
- Single-Page Applications (SPAs): Vue.js is an excellent choice for building dynamic and interactive SPAs.
- User Interfaces (UIs): Vue.js is widely used for creating engaging and responsive UIs.
- Real-Time Updates: Vue.js provides real-time data updates, making it suitable for applications that require live data synchronization.
- Prototyping: Due to its simplicity and flexibility, Vue.js is perfect for rapid prototyping of web applications.
- Cross-Platform Development: Whether you’re building web, mobile, or desktop applications, Vue.js can adapt to different platforms seamlessly.
Vue.js vs Other Frameworks
Feature | Vue.js | React | Angular |
---|---|---|---|
Syntax | Simple and declarative | JSX-based | TypeScript-based |
Learning Curve | Easy | Moderate | Steep |
Performance | High | High | Moderate |
Ecosystem | Vuex, Vue Router | Redux, React Router | Built-in tools |
Use Case | SPAs, Prototypes | Large-scale apps | Enterprise-grade apps |