AppTopbar.vue
<Dropdown v-model="selected" :options="storesLists" @change="onChange"
optionLabel="name" :filter="true" />
onChange(event) {
console.log(event.value.value);
localStorage.setItem('shopid');
}
},
Products.vue
import { useLayout } from '@/layout/composables/layout';
<template>
</template>
AppTopbar is common layout of all pages. when i click onchange AppTopbar.vue is only affectet AppTopbar page only. but i want to if onchange AppTopbar.vue to triger Products.vue and all pages also
how to solve this?
Use a store: https://pinia.vuejs.org/
Set the value in the store and it is available everywhere.