Skip to content

Commit

Permalink
fix(app-vite&app-webpack): Add type for router in Pinia (fix #14061) (#…
Browse files Browse the repository at this point in the history
…14062)

Co-authored-by: Yusuf Kandemir <yusuf.kandemir@outlook.com.tr>
  • Loading branch information
rashidpathiyil and yusufkandemir authored Jul 27, 2022
1 parent d8d2aba commit 81b471b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app-vite/templates/store/pinia/ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { store } from 'quasar/wrappers'
import { createPinia } from 'pinia'
import { Router } from 'vue-router';

/*
* When adding new properties to stores, you should also
* extend the `PiniaCustomProperties` interface.
* @see https://pinia.vuejs.org/core-concepts/plugins.html#typing-new-store-properties
*/
declare module 'pinia' {
export interface PiniaCustomProperties {
readonly router: Router;
}
}

/*
* If not building with SSR mode, you can
Expand Down
12 changes: 12 additions & 0 deletions app-webpack/templates/store/pinia/ts/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
import { store } from 'quasar/wrappers'
import { createPinia } from 'pinia'
import { Router } from 'vue-router';

/*
* When adding new properties to stores, you should also
* extend the `PiniaCustomProperties` interface.
* @see https://pinia.vuejs.org/core-concepts/plugins.html#typing-new-store-properties
*/
declare module 'pinia' {
export interface PiniaCustomProperties {
readonly router: Router;
}
}

/*
* If not building with SSR mode, you can
Expand Down

0 comments on commit 81b471b

Please # to comment.