File tree Expand file tree Collapse file tree 4 files changed +17
-26
lines changed Expand file tree Collapse file tree 4 files changed +17
-26
lines changed Original file line number Diff line number Diff line change @@ -128,10 +128,10 @@ function connect (Vue) {
128
128
129
129
// vuex
130
130
if ( hook . store ) {
131
- initVuexBackend ( hook , bridge , isLegacy )
131
+ initVuexBackend ( hook , bridge , hook . store . commit === undefined )
132
132
} else {
133
133
hook . once ( 'vuex:init' , store => {
134
- initVuexBackend ( hook , bridge , isLegacy )
134
+ initVuexBackend ( hook , bridge , store . commit === undefined )
135
135
} )
136
136
}
137
137
Original file line number Diff line number Diff line change @@ -442,13 +442,21 @@ class VuexBackend {
442
442
} else if ( mutation . handlers ) {
443
443
this . store . _committing = true
444
444
try {
445
- const payload = mutation . payload
445
+ let payload = mutation . payload
446
+
447
+ if ( this . isLegacy && ! Array . isArray ( payload ) ) {
448
+ payload = [ payload ]
449
+ }
450
+
446
451
if ( Array . isArray ( mutation . handlers ) ) {
447
- mutation . handlers . forEach ( handler => handler ( payload ) )
452
+ if ( this . isLegacy ) {
453
+ mutation . handlers . forEach ( handler => handler ( this . store . state , ...payload ) )
454
+ } else {
455
+ mutation . handlers . forEach ( handler => handler ( payload ) )
456
+ }
448
457
} else {
449
- if ( this . isLegacy || SharedData . vuex1 ) {
450
- // Vuex 1
451
- mutation . handlers ( this . store . state , payload )
458
+ if ( this . isLegacy ) {
459
+ mutation . handlers ( this . store . state , ...payload )
452
460
} else {
453
461
mutation . handlers ( payload )
454
462
}
Original file line number Diff line number Diff line change 91
91
May impact performance or cause crashes
92
92
</template >
93
93
</VueFormField >
94
-
95
- <VueFormField
96
- title =" Vuex Legacy"
97
- >
98
- <VueSwitch v-model =" $shared.vuex1" >
99
- Enable compatibility mode
100
- </VueSwitch >
101
- <template #subtitle >
102
- <VueIcon
103
- icon =" warning"
104
- class =" medium"
105
- />
106
- If you use Vuex 1.x, enable this option
107
- </template >
108
- </VueFormField >
109
94
</div >
110
95
</template >
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ const internalSharedData = {
13
13
recordPerf : false ,
14
14
editableProps : false ,
15
15
logDetected : true ,
16
- vuexAutoload : false ,
17
- vuex1 : false
16
+ vuexAutoload : false
18
17
}
19
18
20
19
const persisted = [
@@ -24,8 +23,7 @@ const persisted = [
24
23
'recordVuex' ,
25
24
'editableProps' ,
26
25
'logDetected' ,
27
- 'vuexAutoload' ,
28
- 'vuex1'
26
+ 'vuexAutoload'
29
27
]
30
28
31
29
// ---- INTERNALS ---- //
You can’t perform that action at this time.
0 commit comments