Skip to content

Commit

Permalink
feat(vuex): legacy mode setting, closes vuejs#932
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau authored and iksim committed Apr 18, 2019
1 parent 9932c53 commit edd6ebc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backend/vuex.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export function initVuexBackend (hook, bridge, isLegacy) {
if (Array.isArray(mutation.handlers)) {
mutation.handlers.forEach(handler => handler(payload))
} else {
if (isLegacy) {
if (isLegacy || SharedData.vuex1) {
// Vuex 1
mutation.handlers(store.state, payload)
} else {
Expand Down
15 changes: 15 additions & 0 deletions src/devtools/views/settings/GlobalPreferences.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,20 @@
May impact performance or cause crashes
</template>
</VueFormField>

<VueFormField
title="Vuex Legacy"
>
<VueSwitch v-model="$shared.vuex1">
Enable compatibility mode
</VueSwitch>
<template #subtitle>
<VueIcon
icon="warning"
class="medium"
/>
If you use Vuex 1.x, enable this option
</template>
</VueFormField>
</div>
</template>
6 changes: 4 additions & 2 deletions src/shared-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const internalSharedData = {
recordPerf: false,
editableProps: false,
logDetected: true,
vuexAutoload: false
vuexAutoload: false,
vuex1: false
}

const persisted = [
Expand All @@ -23,7 +24,8 @@ const persisted = [
'recordVuex',
'editableProps',
'logDetected',
'vuexAutoload'
'vuexAutoload',
'vuex1'
]

// ---- INTERNALS ---- //
Expand Down

0 comments on commit edd6ebc

Please sign in to comment.