Skip to content
IT glossary
FrontendUpdated December 3, 2026

Vue.js

Vue.js is a JavaScript framework for building web interfaces from reusable pieces called components. You describe what the page should show, and Vue updates it when the underlying data changes.

Also known as: Vue

What Vue does

Vue lets you describe a user interface in terms of its current state. Think of a search box with a result count: instead of writing code to find the count element and replace its text after every search, you bind the text to the result count and let Vue update it. This is what people mean when they call Vue declarative: you describe what the interface should display rather than listing the steps to update it.

Components give that interface a structure. A product card can take a name and price as props and emit an event when someone clicks “Add to cart.” The parent handles the event and updates the cart. The card can then work in a search result or on a category page without knowing where the cart state lives.

From state to the page

Vue 3 tracks reactive values that a component reads while rendering. ref() wraps a value so Vue can observe reads and writes to .value; reactive() returns a proxy that tracks access to an object's properties. When a tracked value changes, Vue schedules an update for the components that depend on it. An ordinary variable does not become reactive just because it appears in a template.

Vue compiles templates into render functions that produce virtual DOM nodes. On an update, Vue compares the new output with the previous output and patches the browser DOM. It batches DOM updates, so reading an element immediately after changing state can give you the old result. If your code needs the updated DOM, for instance to focus a newly shown input, wait for nextTick().

A working component

<script setup>
import { ref } from 'vue'

const count = ref(0)
function increment() {
  count.value++
}
</script>

<template>
  <button @click="increment">Clicks: {{ count }}</button>
</template>

This is a single-file component (.vue) written with the Composition API and <script setup>. @click connects the button to the handler. The handler uses count.value in JavaScript, while the template unwraps the top-level ref so {{ count }} displays the number directly.

Where it fits and what interviews cover

You can mount Vue on part of an existing page or use it for a full application. Vue Router handles navigation in single-page apps, Pinia can hold state shared across components, and Nuxt adds application-level features such as server-side rendering. A dropdown's open state usually belongs in the dropdown, not in a shared store.

Interviewers often ask you to choose between computed and watch. Use computed when the result is derived from state, such as a filtered list. Use watch when a change should trigger a side effect, such as saving a preference. Another common task is fixing a list that has editable rows: use a stable item ID as the v-for key rather than the array index so an input stays associated with the same item after a reorder.