I have a specific app structure
<header-bar></header-bar>
<bag :bag="bag"></bag>
<!--Main Section-->
<section class="MainSection">
<div class="MainSection__wrap">
<router-view
is="view"
transition="fade"
transition-mode="out-in"
keep-alive
>
</router-view>
</div>
</section>
Upon examination, there exist 2 components and a router view.
The router view displays products retrieved from an API, which can be added to the bag component.
In my products view (part of the router view), there is a method that adds items to the bag by making a POST HTTP Request to the server.
addToBag() {
productService.add(this.item)
.then(item => {
console.log('success !)
})
}
Currently, I am only able to see the items in the bag after reloading the page.
Although dispatching events could potentially solve this issue, the hierarchy of components does not permit me to use it.