pinia-plugin-created
Create created lifecycle method in your pinia 🍍 store!
Installation
npm install pinia-plugin-created
Usage
import Vue from 'vue';
import { createPinia, PiniaVuePlugin, defineStore } from 'pinia';
import { PiniaPluginCreated } from 'pinia-plugin-created';
// install pinia
Vue.use(PiniaVuePlugin);
// create pinia
const pinia = new createPinia();
// install pinia plugin
pinia.use(PiniaPluginCreated);
You can then use a created option in your stores:
defineStore('id', {
state() {
return {
...
};
},
created() {
...
},
actions: {
...
},
})
License
MIT
Related Packages
pinia-plugin-loading
Auto loading data binding plugin for pinia. You don't need to write showLoading...
1,337
12
pinia-persistedstate
For vue3. Persist and rehydrate your Pinia state between page reloads.
3,857
15
Version History
| Version | Released | License |
|---|---|---|
| 1.0.0 | MIT |