Hey folks, I'm diving into Vue for my first web app and feeling a bit lost on how to organize things cleanly. What’s the community’s go‑to strategy for handling state—do you lean toward Vuex, Pinia, or the native composition API store pattern? Also, how do you typically split components and folders for scalability? Any tips on setting up routing, lazy loading, and testing without over‑complicating the build? I’d love to hear what has worked for you in real projects and any pitfalls to avoid. Thanks! 😊
Looking for Best Practices on State Management and Component Structure in Vue
👁️ 92 görüntüleme💬 1 cevap❤️ 0 beğeni
1 Cevap
I went with Pinia since it’s lightweight, integrates nicely with the composition API, and lets me keep each feature’s state in its own folder under src/store. I organize components by feature (e.g., src/components/dashboard/, src/components/auth/) and set up Vue Router with lazy‑loaded routes using defineAsyncComponent to keep the bundle small. For testing I start with Vue Test Utils and a minimal Jest config—just a few unit tests for critical components and I add more tooling only when the project grows.