Skip to content

Commit c98770a

Browse files
author
Guillaume Chau
committed
feat(vuex): legacy mode setting, closes #932
1 parent 28eb0b2 commit c98770a

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

src/backend/vuex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export function initVuexBackend (hook, bridge, isLegacy) {
301301
if (Array.isArray(mutation.handlers)) {
302302
mutation.handlers.forEach(handler => handler(payload))
303303
} else {
304-
if (isLegacy) {
304+
if (isLegacy || SharedData.vuex1) {
305305
// Vuex 1
306306
mutation.handlers(store.state, payload)
307307
} else {

src/devtools/views/settings/GlobalPreferences.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,20 @@
9191
May impact performance or cause crashes
9292
</template>
9393
</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>
94109
</div>
95110
</template>

src/shared-data.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const internalSharedData = {
1313
recordPerf: false,
1414
editableProps: false,
1515
logDetected: true,
16-
vuexAutoload: false
16+
vuexAutoload: false,
17+
vuex1: false
1718
}
1819

1920
const persisted = [
@@ -23,7 +24,8 @@ const persisted = [
2324
'recordVuex',
2425
'editableProps',
2526
'logDetected',
26-
'vuexAutoload'
27+
'vuexAutoload',
28+
'vuex1'
2729
]
2830

2931
// ---- INTERNALS ---- //

0 commit comments

Comments
 (0)