Skip to content

Best place to fetch data for authed users in Vue app?

Hi I’m fetching a arrays of posts from my express API in the Home.vue which is protected by route guards. fetchPosts action: In my action I commit a mutation which sets the posts object to res.data. I only want to fetchPosts when user logs in since I have a mutation which adds the post to the db and upd…

Join specific items in an array [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question I woul…

not able to access the dynamic id in a table row

Inside a table <td> I have put this code and not able to fetch the id inside the td. Id can not be fetched and not able to pass the id in href. Answer Code works if you rename the id to myId. There is likely a window.id that is shadowing your variable

How do I create multiple pages within my domain using React?

When a user goes to my domain www.example.com they see my webpage I created using React. I want to use React to show them a different webpage when they go to www.example.com/anotherpage instead. This is the code I have in my index.js file which creates the webpage at www.example.com, Answer There are multiple…