Skip to content

Commit

Permalink
do not use setPath/getPath
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 18, 2016
1 parent 9e44151 commit bd17dd1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ class Store {
*/

_setupModuleState (state, modules) {
const { setPath } = Vue.parsers.path
Object.keys(modules).forEach(key => {
setPath(state, key, modules[key].state || {})
Vue.set(state, key, modules[key].state || {})
})
}

Expand All @@ -155,7 +154,6 @@ class Store {

_setupModuleMutations (updatedModules) {
const modules = this._modules
const { getPath } = Vue.parsers.path
const allMutations = [this._rootMutations]
Object.keys(updatedModules).forEach(key => {
modules[key] = updatedModules[key]
Expand All @@ -168,7 +166,7 @@ class Store {
Object.keys(module.mutations).forEach(name => {
const original = module.mutations[name]
mutations[name] = (state, ...args) => {
original(getPath(state, key), ...args)
original(state[key], ...args)
}
})
allMutations.push(mutations)
Expand Down

0 comments on commit bd17dd1

Please sign in to comment.