0.1.2 • Published 2 years ago

pinia-plugin-router v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

pinia-plugin-router

A pinia plugin to help you use vue-router in pinia store

Installation

pnpm add pinia-plugin-router -D

or

npm install pinia-plugin-router -D

Usage

import PiniaRouter from "pinia-plugin-router"
import {router} from "./router"//your router
const pinia = createPinia()
pinia.use(PiniaRouter(router))
// in your store

const store = defineStore("store",{
    actions:{
        jump(){
            this.$router.push('/demo')
        }
    }
})

Related

created by template (starter-ts)https://github.com/OceanPresentChao/starter-ts