I'm currently working on an application using Vue and Laravel. Instead of relying on vue-router
, Laravel is managing my routes.
Within my parent component, I am dynamically loading components based on the state of an object in the data.
One of the methods in my parent component looks like this:
activateListingForm: function() {
this.listingFormActive = !this.listingFormActive;
}
There's a button that triggers this method to toggle the value of this.listingFormActive
.
Then in the template of the component, I have the following:
<transition name="slide-fade">
<create-listing-form v-if="listingFormActive"></create-listing-form>
<listings-table v-else></listings-table>
</transition>
An issue I'm encountering is that some users are clicking the back button in their browser expecting the previous component to load. Is there a way to adjust the state based on the back button?
Thank you!