0👍
There a few way you can handle this
- You could
emit
an event at startup. In your case runningbus.$emit("contentChange", "Delaware");
But you could have timing issues, if you fire the event, but the listening components aren’t initialised then you’ll miss it. - A more robust method would be to use Vuex. You’ll set up your store and trigger a mutation at the start that sets the default location. After that any component can use the state to figure out what is the current selected location.
- [Vuejs]-How to show active state on hover/focus in two elements at the same time in Vue.js/Vuex
- [Vuejs]-How to display fixed number of elements of v-for inside v-window
Source:stackexchange.com