Vue.js / Nuxt.js

Vue Router

Routes, navigation, router-link, dynamic routes, route params, query parameters, navigation guards

18 perguntas de entrevista·
Junior
1

What is Vue Router?

Resposta

Vue Router is the official routing library for Vue.js. It enables creating single-page applications with navigation between different views without page reloads. Vue Router manages browser history, URL parameters and provides advanced features like navigation guards to control route access.

2

What is the main advantage of using router-link instead of an <a> tag?

Resposta

The router-link component prevents full page reloads during navigation, unlike a standard <a> tag. It intercepts clicks to perform client-side navigation using the browser's History API. This preserves application state and provides a smooth user experience without loading latency.

3

How to define a simple route in Vue Router?

Resposta

A simple route is defined by creating an object with path and component properties in the routes array. The path indicates the URL (like /about) and component specifies the Vue component to display. This minimal configuration is sufficient to create functional navigation in the application.

4

What is the purpose of the router-view component?

5

Which property of router-link specifies the destination?

+15 perguntas de entrevista

Domine Vue.js / Nuxt.js para sua proxima entrevista

Acesse todas as perguntas, flashcards, testes tecnicos, exercicios de code review e simuladores de entrevista.

Comece gratis