Vue.js / Nuxt.js

Vue Basics

Vue instances, templates, directives (v-if, v-for, v-bind, v-on), data binding, computed properties, watchers

22 interview questions·
Junior
1

What is a Vue instance?

Answer

A Vue instance is the object created by calling createApp() that represents the application. This root object contains all reactive data, methods, and configuration options. It serves as the entry point for mounting the application to a DOM element and initializing Vue's reactivity system.

2

What is the purpose of the v-bind directive?

Answer

The v-bind directive allows dynamically binding HTML attributes to JavaScript expressions. It evaluates the expression and automatically updates the attribute when the data changes. This directive is essential for creating reactive interfaces where attributes like src, href, class, or disabled must reflect the application state.

3

What is the shorthand syntax for v-bind:href?

Answer

The shorthand syntax simply uses a colon followed by the attribute name. This shortened notation is very common in Vue projects because it improves code readability while maintaining exactly the same functionality. It works for all HTML and custom attributes.

4

What is the purpose of the v-on directive?

5

What is the shorthand syntax for v-on:click?

+19 interview questions

Master Vue.js / Nuxt.js for your next interview

Access all questions, flashcards, technical tests, code review exercises and interview simulators.

Start for free