0👍
Figured it out. Leaving an answer in case someone else has the same issue.
Remove the router event, and the eventBus listener.
In the Styles component, mounted
is triggered every time the router changes, and when it’s loaded with no router change.
Inertia has a usePage
utility, which can be used in mounted
.
Styles.vue
import { usePage } from '@inertiajs/vue3'
export default {
...
mounted(){
const active_styles = usePage().props.active_styles;
this.someFunction(active_styles);
},
...
};
- [Vuejs]-A List with several Columns in VUE JS projects
- [Vuejs]-How to upload an image to folder src/assets in vuejs
Source:stackexchange.com