From c2efc29f689cec0e85af17750cf1f5f0552479b0 Mon Sep 17 00:00:00 2001 From: Zam <24277775+zam157@users.noreply.github.com> Date: Sun, 15 Dec 2024 19:26:38 +0800 Subject: [PATCH] fix: computed for app-plus (uni-app) --- .../@vue/composition-api/dist/vue-composition-api.common.js | 4 +++- .../composition-api/dist/vue-composition-api.common.prod.js | 2 +- .../@vue/composition-api/dist/vue-composition-api.esm.js | 4 +++- .../packages/@vue/composition-api/dist/vue-composition-api.js | 4 +++- .../@vue/composition-api/dist/vue-composition-api.mjs | 4 +++- .../@vue/composition-api/dist/vue-composition-api.prod.js | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/packages/vue-cli-plugin-uni/packages/@vue/composition-api/dist/vue-composition-api.common.js b/packages/vue-cli-plugin-uni/packages/@vue/composition-api/dist/vue-composition-api.common.js index d9fa3696f7b..a908db481ce 100644 --- a/packages/vue-cli-plugin-uni/packages/@vue/composition-api/dist/vue-composition-api.common.js +++ b/packages/vue-cli-plugin-uni/packages/@vue/composition-api/dist/vue-composition-api.common.js @@ -1484,13 +1484,15 @@ function computed(getterOrOptions) { var _a = getVueInternalClasses(), Watcher_1 = _a.Watcher, Dep_1 = _a.Dep; var watcher_1; computedGetter = function () { + var _a; if (!watcher_1) { watcher_1 = new Watcher_1(vm, getter, noopFn, { lazy: true }); } if (watcher_1.dirty) { watcher_1.evaluate(); } - if (Dep_1.target) { + // ensure that computed works in the app-plus environment + if (Dep_1.target || ((_a = Dep_1.SharedObject) === null || _a === void 0 ? void 0 : _a.target)) { watcher_1.depend(); } return watcher_1.value; diff --git a/packages/vue-cli-plugin-uni/packages/@vue/composition-api/dist/vue-composition-api.common.prod.js b/packages/vue-cli-plugin-uni/packages/@vue/composition-api/dist/vue-composition-api.common.prod.js index ffb40ed5986..6857bc1ffb8 100644 --- a/packages/vue-cli-plugin-uni/packages/@vue/composition-api/dist/vue-composition-api.common.prod.js +++ b/packages/vue-cli-plugin-uni/packages/@vue/composition-api/dist/vue-composition-api.common.prod.js @@ -1 +1 @@ -"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},t(n,e)};var n,e=function(){return e=Object.assign||function(t){for(var n,e=1,r=arguments.length;e=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function i(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o=0&&Math.floor(n)===n&&isFinite(t)&&n<=4294967295}function U(t){return null!==t&&"object"==typeof t}function A(t){return"[object Object]"===function(t){return Object.prototype.toString.call(t)}(t)}function B(t){return"function"==typeof t}function W(t,n){return n=n||x()}function T(t,n){void 0===n&&(n={});var e=t.config.silent;t.config.silent=!0;var r=new t(n);return t.config.silent=e,r}function V(t,n){return function(){for(var e=[],r=0;r1?e&&B(n)?n():n:void 0}},exports.isRaw=rt,exports.isReactive=ot,exports.isReadonly=function(t){return L.has(t)},exports.isRef=Z,exports.markRaw=function(t){if(!A(t)&&!R(t)||!Object.isExtensible(t))return t;var n=ct();return n.__v_skip=!0,k(t,"__ob__",n),q.set(t,!0),t},exports.nextTick=function(){for(var t,n=[],e=0;e=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function i(t,n,e){if(e||2===arguments.length)for(var r,o=0,i=n.length;o=0&&Math.floor(n)===n&&isFinite(t)&&n<=4294967295}function U(t){return null!==t&&"object"==typeof t}function A(t){return"[object Object]"===function(t){return Object.prototype.toString.call(t)}(t)}function B(t){return"function"==typeof t}function W(t,n){return n=n||x()}function T(t,n){void 0===n&&(n={});var e=t.config.silent;t.config.silent=!0;var r=new t(n);return t.config.silent=e,r}function V(t,n){return function(){for(var e=[],r=0;r1?e&&B(n)?n():n:void 0}},exports.isRaw=rt,exports.isReactive=ot,exports.isReadonly=function(t){return L.has(t)},exports.isRef=Z,exports.markRaw=function(t){if(!A(t)&&!R(t)||!Object.isExtensible(t))return t;var n=ft();return n.__v_skip=!0,k(t,"__ob__",n),q.set(t,!0),t},exports.nextTick=function(){for(var t,n=[],e=0;e=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var r,o,i=e.call(n),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function u(n,t,e){if(e||2===arguments.length)for(var r,o=0,i=t.length;o=0&&Math.floor(t)===t&&isFinite(n)&&t<=4294967295}function B(n){return null!==n&&"object"==typeof n}function T(n){return"[object Object]"===function(n){return Object.prototype.toString.call(n)}(n)}function V(n){return"function"==typeof n}function W(n,t){return t=t||$()}function z(n,t){void 0===t&&(t={});var e=n.config.silent;n.config.silent=!0;var r=new n(t);return n.config.silent=e,r}function F(n,t){return function(){for(var e=[],r=0;r1?e&&V(t)?t():t:void 0}},n.isRaw=un,n.isReactive=fn,n.isReadonly=function(n){return H.has(n)},n.isRef=tn,n.markRaw=function(n){if(!T(n)&&!M(n)||!Object.isExtensible(n))return n;var t=vn();return t.__v_skip=!0,C(n,"__ob__",t),G.set(n,!0),n},n.nextTick=function(){for(var n,t=[],e=0;e=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var r,o,i=e.call(n),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(n){o={error:n}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}function u(n,t,e){if(e||2===arguments.length)for(var r,o=0,i=t.length;o=0&&Math.floor(t)===t&&isFinite(n)&&t<=4294967295}function B(n){return null!==n&&"object"==typeof n}function T(n){return"[object Object]"===function(n){return Object.prototype.toString.call(n)}(n)}function V(n){return"function"==typeof n}function W(n,t){return t=t||$()}function z(n,t){void 0===t&&(t={});var e=n.config.silent;n.config.silent=!0;var r=new n(t);return n.config.silent=e,r}function F(n,t){return function(){for(var e=[],r=0;r1?e&&V(t)?t():t:void 0}},n.isRaw=un,n.isReactive=fn,n.isReadonly=function(n){return H.has(n)},n.isRef=tn,n.markRaw=function(n){if(!T(n)&&!M(n)||!Object.isExtensible(n))return n;var t=vn();return t.__v_skip=!0,C(n,"__ob__",t),G.set(n,!0),n},n.nextTick=function(){for(var n,t=[],e=0;e