Answer the question
In order to leave comments, you need to log in
Where to place Vue app logic when using shared store?
There is an application, which is a list of comments with an infinite nesting.
When creating a response to any of the comments, regardless of nesting, you must send a POST to create an entry in the database and insert an instance of the created comment into the parent or root.
I suppose that you can put this logic in store action :
- describe a mutation to add an item to the general list of comments
- make a request to add to the database
- upon successful entry to the database - commit the mutation to add to the parent object or to the root
The application looks like this:
i.imgur.com/CUJqgwE.png
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question