I am currently in the process of constructing a vuejs application using webpack, vuex, and vue-router.
The organization of my project is as follows:
[components]
- BlockingLayer.vue
[store]
- index.js
[restapi]
- index.js
App.vue
main.js
Within App.vue, I am utilizing BlockingLayer.vue. There are methods within App.vue that control the visibility of BlockingLayer.
My next objective is to trigger these methods from the [restapi] index.js - how can this be accomplished?
Initial attempts at importing App.vue inside the restapi module have been unsuccessful. However, importing store within restapi has worked seamlessly. Similarly, importing restapi within store and utilizing it has also proven to be effective. One potential solution may involve utilizing a variable within the store instead of within App.vue to manage the visibility of BlockingLayer, although this method may not align with the intended use of the store.