From 2ed86a03b5214c48e77f5cbc5e334a5ffd1c838a Mon Sep 17 00:00:00 2001 From: dj <1042039504@qq.com> Date: Thu, 5 Feb 2026 23:38:51 +0800 Subject: [PATCH] =?UTF-8?q?refactor(vue):=20=E6=9E=84=E5=BB=BAref=E7=AE=80?= =?UTF-8?q?=E5=8D=95=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/shared/src/index.ts | 4 +--- .../vue/examples/reactivity/ref-shallow.html | 21 +++++++++++++++++++ packages/vue/examples/reactivity/ref.html | 9 ++++---- 3 files changed, 26 insertions(+), 8 deletions(-) create mode 100644 packages/vue/examples/reactivity/ref-shallow.html diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts index c61acce..480fe58 100644 --- a/packages/shared/src/index.ts +++ b/packages/shared/src/index.ts @@ -5,9 +5,7 @@ export const isObject = (val: unknown) => val !== null && typeof val === 'object' /** - * 对比两个数据是否发生改变 - * @param value - * @param oldValue + * 对比两个数据是否发生改变, 如果发生改变则返回true */ export const hasChanged = (value: any, oldValue: any): boolean => !Object.is(value, oldValue) diff --git a/packages/vue/examples/reactivity/ref-shallow.html b/packages/vue/examples/reactivity/ref-shallow.html new file mode 100644 index 0000000..f6fbb38 --- /dev/null +++ b/packages/vue/examples/reactivity/ref-shallow.html @@ -0,0 +1,21 @@ + +
+ + +