Vue.js

108 readers
2 users here now

A community all about the Vue.js framework. Version 2 / 3, Vuex, Router, Nuxt. Learning and mastering this framework.

founded 4 years ago
MODERATORS
1
 
 

publication croisée depuis : https://jlai.lu/post/27570443

Hi there, I'm working on a new app with Vuejs 3 and I wonder what are the good practice to architecture the app and to handle guards, JWT token refresh, reactivity and not having spaghetti code.

I started with the basic Vuetify app and added Pinia and the vue-router. 🤠

One problem I want to solve is how to get the list to populate the first page with a list of objects, lets say a book list. Right now I created a store.books list and an action to call the API, according to the doc ( https://pinia.vuejs.org/core-concepts/actions.html ). But then I have to call the action when the user log in, or when the component is mounted, or when there is a refresh.

I found it not very DRY and just not smart, so I need some help and good doc to understand how to structure my app.

Thank you 😌