Skip to content

Commit bd17dd1

Browse files
committed
do not use setPath/getPath
1 parent 9e44151 commit bd17dd1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ class Store {
140140
*/
141141

142142
_setupModuleState (state, modules) {
143-
const { setPath } = Vue.parsers.path
144143
Object.keys(modules).forEach(key => {
145-
setPath(state, key, modules[key].state || {})
144+
Vue.set(state, key, modules[key].state || {})
146145
})
147146
}
148147

@@ -155,7 +154,6 @@ class Store {
155154

156155
_setupModuleMutations (updatedModules) {
157156
const modules = this._modules
158-
const { getPath } = Vue.parsers.path
159157
const allMutations = [this._rootMutations]
160158
Object.keys(updatedModules).forEach(key => {
161159
modules[key] = updatedModules[key]
@@ -168,7 +166,7 @@ class Store {
168166
Object.keys(module.mutations).forEach(name => {
169167
const original = module.mutations[name]
170168
mutations[name] = (state, ...args) => {
171-
original(getPath(state, key), ...args)
169+
original(state[key], ...args)
172170
}
173171
})
174172
allMutations.push(mutations)

0 commit comments

Comments
 (0)