Loading...
Loading...
ALWAYS use when writing code importing "pinia". Consult for debugging, best practices, or modifying pinia.
npx skill4agent add harlan-zw/vue-ecosystem-skills pinia-skilldpiniadefineStore({ id: 'storeName', ... })iddefineStore('storeName', { ... })PiniaStorePluginPiniaPluginPiniaStorePluginAwaitedtype: moduleaction(fn, name?)SetupStoreHelpers$onActiondisposePinia(pinia)SetupStoreDefinition<Id, SS>defineStore()StoreDefinitionmapWritableStatecomputedrefWritableComputedRefmapGettersmapStategetActivePinia()Pinia | undefinedskipHydrate(obj)shouldHydrate(obj)$patch()$subscribe()watch()$patch$patch{ detached: true }$subscribe()true$onAction()skipHydrate()localStoragereturn {
lastColor: skipHydrate(lastColor), // won't be overwritten by SSR state
open,
}store.$statestoretoRef(store.$state, 'key')markRaw()useOtherStore()awaitawaitcreateTestingPinia()@pinia/testingcreatePinia()pluginstestingPinia.use()statethisthis