feat: use vuex 4 for vue3
This commit is contained in:
parent
72518212da
commit
3d6aca3510
4 changed files with 25 additions and 11 deletions
|
@ -37,7 +37,7 @@
|
|||
"vue-router": "4.0.11",
|
||||
"vue-shortkey": "3.1.7",
|
||||
"vuedraggable": "2.24.3",
|
||||
"vuex": "3.6.2",
|
||||
"vuex": "4.0.2",
|
||||
"workbox-precaching": "6.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import { createStore } from 'vuex'
|
||||
import {
|
||||
CURRENT_LIST,
|
||||
ERROR_MESSAGE,
|
||||
|
@ -21,9 +20,7 @@ import labels from './modules/labels'
|
|||
|
||||
import ListService from '../services/list'
|
||||
|
||||
Vue.use(Vuex)
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
export const store = createStore({
|
||||
strict: import.meta.env.DEV,
|
||||
modules: {
|
||||
config,
|
||||
|
|
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>
|
||||
}
|
||||
}
|
12
yarn.lock
12
yarn.lock
|
@ -1785,7 +1785,7 @@
|
|||
"@vue/compiler-dom" "3.2.14"
|
||||
"@vue/shared" "3.2.14"
|
||||
|
||||
"@vue/devtools-api@^6.0.0-beta.14":
|
||||
"@vue/devtools-api@^6.0.0-beta.11", "@vue/devtools-api@^6.0.0-beta.14":
|
||||
version "6.0.0-beta.15"
|
||||
resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.0.0-beta.15.tgz#ad7cb384e062f165bcf9c83732125bffbc2ad83d"
|
||||
integrity sha512-quBx4Jjpexo6KDiNUGFr/zF/2A4srKM9S9v2uHgMXSU//hjgq1eGzqkIFql8T9gfX5ZaVOUzYBP3jIdIR3PKIA==
|
||||
|
@ -6951,10 +6951,12 @@ vuedraggable@2.24.3:
|
|||
dependencies:
|
||||
sortablejs "1.10.2"
|
||||
|
||||
vuex@3.6.2:
|
||||
version "3.6.2"
|
||||
resolved "https://registry.yarnpkg.com/vuex/-/vuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71"
|
||||
integrity sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw==
|
||||
vuex@4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/vuex/-/vuex-4.0.2.tgz#f896dbd5bf2a0e963f00c67e9b610de749ccacc9"
|
||||
integrity sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==
|
||||
dependencies:
|
||||
"@vue/devtools-api" "^6.0.0-beta.11"
|
||||
|
||||
w3c-hr-time@^1.0.2:
|
||||
version "1.0.2"
|
||||
|
|
Loading…
Reference in a new issue