Pinia is Vue's official state-management library (the successor to Vuex) — a centralized store for state that needs to be shared across many components, with a simple, type-safe API built on the Composition API.
Defining a store
{ defineStore } ;
{ ref, computed } ;
useCounterStore = (, {
count = ();
double = ( count. * );
() { count.++; }
() { count. = api.(); }
{ count, double, increment, fetchInitial };
});
