diff --git a/packages/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js b/packages/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js index 281178e6ef600e056cfbcd11f6648df1d9c478d8..4f4fe1a6f23eda36a47d03a574a8b423481fb1b0 100644 --- a/packages/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js +++ b/packages/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js @@ -711,8 +711,8 @@ Dep.prototype.removeSub = function removeSub (sub) { }; Dep.prototype.depend = function depend () { - if (Dep.target) { - Dep.target.addDep(this); + if (Dep.SharedObject.target) { + Dep.SharedObject.target.addDep(this); } }; @@ -733,17 +733,20 @@ Dep.prototype.notify = function notify () { // The current target watcher being evaluated. // This is globally unique because only one watcher // can be evaluated at a time. -Dep.target = null; +// fixed by xxxxxx (nvue shared vuex) +/* eslint-disable no-undef */ +Dep.SharedObject = typeof SharedObject !== 'undefined' ? SharedObject : {}; +Dep.SharedObject.target = null; var targetStack = []; function pushTarget (target) { targetStack.push(target); - Dep.target = target; + Dep.SharedObject.target = target; } function popTarget () { targetStack.pop(); - Dep.target = targetStack[targetStack.length - 1]; + Dep.SharedObject.target = targetStack[targetStack.length - 1]; } /* */ @@ -1028,7 +1031,7 @@ function defineReactive$$1 ( configurable: true, get: function reactiveGetter () { var value = getter ? getter.call(obj) : val; - if (Dep.target) { + if (Dep.SharedObject.target) { // fixed by xxxxxx dep.depend(); if (childOb) { childOb.dep.depend(); @@ -4751,7 +4754,7 @@ function createComputedGetter (key) { if (watcher.dirty) { watcher.evaluate(); } - if (Dep.target) { + if (Dep.SharedObject.target) {// fixed by xxxxxx watcher.depend(); } return watcher.value