
Vue Components
Component lifecycle, props, events, slots, scoped styles, component communication, dynamic components
1What is a Vue component?
What is a Vue component?
Jawaban
A Vue component is a reusable Vue instance with a name. It encapsulates HTML, CSS and JavaScript into an independent logical unit. Components allow dividing the user interface into reusable and maintainable pieces. Each component has its own template, logic and styles, facilitating code organization and reusability.
2How to declare props in a Vue 3 component with script setup?
How to declare props in a Vue 3 component with script setup?
Jawaban
In Vue 3 with script setup, defineProps() is a compiler macro that allows declaring props without explicit import. This macro automatically generates the necessary code and exposes props to the template. It supports TypeScript and JavaScript type validation, making the code more concise and type-safe than the Options API approach.
3What is the function of the onMounted() hook in a component lifecycle?
What is the function of the onMounted() hook in a component lifecycle?
Jawaban
The onMounted() hook executes after the component has been mounted to the DOM. This is the ideal moment to perform operations that require DOM access, like initializing third-party libraries, fetching data via API, or directly manipulating DOM elements. At this stage, the template is rendered and refs are accessible.
How does a child component emit an event to its parent component?
What are slots used for in a Vue component?
+17 pertanyaan wawancara
Topik wawancara Vue.js / Nuxt.js lainnya
JavaScript Fundamentals
Modern JavaScript (ES6+)
Vue Basics
Vue Router
Pinia State Management
Vuex (Legacy)
Composition API
Vue Reactivity
Nuxt Fundamentals
Nuxt Data Fetching
Nuxt SSR & SSG
Nuxt Server Routes
Nuxt Modules
Vue Composables
Vue Forms & Validation
Nuxt State Management
Vue Testing
Nuxt Deployment & CI/CD
Vue Performance
Vue Advanced Patterns
TypeScript with Vue
Nuxt Authentication
SEO with Nuxt
Nuxt Internationalization
Vue Architecture
Nuxt Security
Vue Ecosystem
Migration Vue 2→3 & Nuxt 2→3
Kuasai Vue.js / Nuxt.js untuk wawancara berikutnya
Akses semua pertanyaan, flashcards, tes teknis, latihan code review dan simulator wawancara.
Mulai gratis