Is there someone familiar with Vuex and Vue.js that could help me with some code?
Either by handing me advice, or point me towards some similar situation to solve my problem.
I have a comment section (module: comments) representing an array of comment object.
Each comment have a 'tags section', 'replies section', needing to be reactive on mutations and to store mutations in db.
comments, tags, replies) - would fill comments module with unrepresentative actionsreplies, tags' and asociated actions living as vue data of components 'replies section' and 'tags section'comments, replies, tags)with mention of that my API returns nested object:
`comments:[
{
id,
title,
text,
replies: [{
id,
author: {id, name}
comment_id,
text
}],
tags: [similar with replies]
},
//
]`
If you have a lot of relational/nested data, I'd suggest trying vuex-orm. It allows you to normalize your data schema within Vuex Store with relationships, as you would represent it in regular DB. It also has a lot of integrations with axios, GraphQL, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With