pinia-plugin-undo-redo
v1.0.0
Published
Change pinia state history easily
Downloads
2
Maintainers
Readme
A Pinia plugin that is able to undo and redo a action easily.
Install
npm
npm install --save-dev pinia-plugin-undo-redo
yarn
yarn add -D pinia-plugin-undo-redo
pnpm
pnpm install -D pinia-plugin-undo-redo
usage
main.js
import pinia from './store'
// omit...
app.use(pinia)
store.js
import { createPinia } from 'pinia'
import PiniaUndoAndRedo from '../../index'
const pinia = createPinia()
pinia.use(PiniaUndoAndRedo)
app use
import { useStore } from '@/store'
const store = useStore()
store.redo()
store.undo()