codejump

Lazy Loading & Transitions

Preview — 3 of 10 questions

What is the difference between using webpackChunkName comments and Vite's rollupOptions.manualChunks for route splitting?

AThey are identical — both achieve the same result regardless of bundler
BNeither approach provides chunk grouping — each import() always creates its own chunk
CwebpackChunkName works in Vite by default; manualChunks is only for Webpack
DwebpackChunkName is a Webpack magic comment for grouping chunks; Vite uses rollupOptions.manualChunks or vite-plugin-chunk-split for equivalent control

How do you implement different transition animations for different routes?

AUse <router-view v-slot="{ Component, route }"> with a <transition> whose name comes from route.meta.transition
BUse CSS transitions in the <router-view> without any special configuration
CConfigure transition directly in the router scrollBehavior option
DUse the transition prop on <router-link> components

How do you handle navigation to the same route with different params without component remount?

AIt's impossible — same-route navigation always causes a full remount
BVue Router automatically reuses the component; use onBeforeRouteUpdate to react to param changes
CUse router.replace() instead of router.push() to prevent remount
DAdd { replace: true, force: true } to the navigation options

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.