pinia-plugin-router
A pinia plugin that help use vue-router in pinia
4,356
| Install | |
|---|---|
npm install pinia-plugin-router |
|
| Latest Version: | 0.1.2 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 25, 2022 |
| Links: | npm |
Maintainer: oceanpresent
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]
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 | Vue | License |
|---|---|---|---|
| 0.1.2 | ^3.2.37 | MIT | |
| 0.1.1 | ^3.2.37 | MIT | |
| 0.1.0 | ^3.2.37 | MIT |