- Lazy loading routes:
() => import('./views/Heavy.vue') v-oncefor static content that never changesv-memoto prevent re-renders of sublistsshallowReffor large non-edited datacomputedinstead of methods (caching)- Virtual scrolling for long lists (vue-virtual-scroller)
- Code splitting with
defineAsyncComponent - Debounce on search/filter inputs
v-showinstead ofv-iffor frequent toggles- Avoid unnecessary watchers, prefer computed when possible
Diagnosing:
- Vue DevTools → Performance timeline
- Browser DevTools → Performance tab → flame chart
vite-bundle-visualizerto analyze bundle size- Network tab for redundant API calls