The basic architecture is a server-side rendered HTML page with Vue.js handling the presentation layer of some, but not all, pages of the site. We are making something a bit like a Trello card or Github issue. The main data model is a “Task” object, which has various properties: progress-status, sub-tasks and comments.
We want to display these objects on the page, allowing the user to create and update them and their sub objects, which are rendered as separate components.
Our problem is in finding the right way to communicate changes from the objects to the backend server, and back again. We are using Axios to speak to our backend (which is running on Django Rest Framework).
Initially, we implemented a complex chain of watchers to track state changes in the app, allowing them to be emitted up through the hierarchy of Vue components to the Axios HTTP methods. However, this seems a little brittle and certainly complicated to maintain.
Should we instead be using Vuex to manage the state of the app? Or the simpler event bus pattern described in the documentation?