Vue.js / Nuxt.js

Vue Basics

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

22 câu hỏi phỏng vấn·
Junior
1

What is a Vue instance?

Câu trả lời

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?

Câu trả lời

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?

Câu trả lời

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 câu hỏi phỏng vấn

Nắm vững Vue.js / Nuxt.js cho lần phỏng vấn tiếp theo

Truy cập tất cả câu hỏi, flashcards, bài kiểm tra kỹ thuật, bài tập code review và mô phỏng phỏng vấn.

Bắt đầu miễn phí