feat: use vuex 4 for vue3
This commit is contained in:
parent
72518212da
commit
3d6aca3510
4 changed files with 25 additions and 11 deletions
15
src/types/shims-vue.d.ts
vendored
15
src/types/shims-vue.d.ts
vendored
|
|
@ -2,3 +2,18 @@ declare module '*.vue' {
|
|||
import Vue from 'vue'
|
||||
export default Vue
|
||||
}
|
||||
|
||||
// https://next.vuex.vuejs.org/guide/migrating-to-4-0-from-3-x.html#typescript-support
|
||||
import { ComponentCustomProperties } from 'vue'
|
||||
import { Store } from 'vuex'
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
// Declare your own store states.
|
||||
interface State {
|
||||
count: number
|
||||
}
|
||||
|
||||
interface ComponentCustomProperties {
|
||||
$store: Store<State>
|
||||
}
|
||||
}
|
||||
Reference in a new issue