pinia-plugin-created

1.0.0Β β€’Β PublicΒ β€’Β Published

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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i pinia-plugin-created

      Weekly Downloads

      2

      Version

      1.0.0

      License

      MIT

      Unpacked Size

      2.43 kB

      Total Files

      5

      Last publish

      Collaborators

      • zhennann