From 4cb767f920a5568f1838cd1b62e39bf596b8face Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 21 Jan 2022 10:02:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/fix/fix.js | 5 +++++ dist/fix/fix.proxy.js | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/dist/fix/fix.js b/dist/fix/fix.js index e16bdf99f..63ebd6374 100644 --- a/dist/fix/fix.js +++ b/dist/fix/fix.js @@ -904,6 +904,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons return target; } + function freeze() { + return Object.freeze.apply(null, arguments); + } + /** * Delete a property and trigger change if necessary. */ @@ -1519,6 +1523,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons exports.notify = notify; exports.defineReactive = defineReactive; exports.set = set; + exports.freeze = freeze; exports.del = del; exports.Watcher = Watcher; exports.pushTarget = pushTarget; diff --git a/dist/fix/fix.proxy.js b/dist/fix/fix.proxy.js index f332da88b..19eca6178 100644 --- a/dist/fix/fix.proxy.js +++ b/dist/fix/fix.proxy.js @@ -1838,6 +1838,7 @@ if (!runner.effect.active) { return; } + if (cb) { // watch(source, cb) var newValue = runner(); @@ -2404,6 +2405,15 @@ } target[key] = val; + return target; + } + function freeze(value) { + Object.defineProperty(value, '__v_skip', { + configurable: true, + enumerable: false, + value: value + }); + return value; } function del(target, key) { if (_.isArray(target)) { @@ -2456,6 +2466,7 @@ exports.config = config; exports.define = define; exports.del = del; + exports.freeze = freeze; exports.mixin = mixin; exports.set = set; exports.toJSON = toJSON;