From a30ff6e7c243d2a782d9ac6db0a2829d2bdd3c79 Mon Sep 17 00:00:00 2001
From: zhenyuWang <13641039885@163.com>
Date: Wed, 8 May 2024 19:40:45 +0800
Subject: [PATCH] refactor: optimize code

---
 components/uni-collapse-item/uni-collapse-item.vue | 2 +-
 components/uni-collapse/uni-collapse.vue           | 2 +-
 pages/directive/v-bind/Foo-composition.uvue        | 1 +
 pages/directive/v-text/v-text.test.js              | 2 +-
 pages/reactivity/core/watch/watch-composition.uvue | 1 -
 pages/reactivity/core/watch/watch-options.uvue     | 2 --
 6 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/components/uni-collapse-item/uni-collapse-item.vue b/components/uni-collapse-item/uni-collapse-item.vue
index afacaae..8ac013d 100644
--- a/components/uni-collapse-item/uni-collapse-item.vue
+++ b/components/uni-collapse-item/uni-collapse-item.vue
@@ -60,7 +60,7 @@
 			openCollapse(open: boolean) {
 				if (this.disabled) return
 				// 关闭其他已打开
-				$dispatch(this, 'UniCollapse', 'cloceAll')
+				$dispatch(this, 'UniCollapse', 'closeAll')
 				this.is_open = open
 				this.openOrClose(open)
 			},
diff --git a/components/uni-collapse/uni-collapse.vue b/components/uni-collapse/uni-collapse.vue
index 8c093e6..0b7e7c3 100644
--- a/components/uni-collapse/uni-collapse.vue
+++ b/components/uni-collapse/uni-collapse.vue
@@ -26,7 +26,7 @@
 				this.child_nodes.push(child)
 			},
 			// 关闭所有
-			cloceAll() {
+			closeAll() {
 				// 开启手风琴效果才回关闭其他
 				if (this.accordion && this.child_nodes.length > 0) {
 					this.child_nodes.forEach((item) => {
diff --git a/pages/directive/v-bind/Foo-composition.uvue b/pages/directive/v-bind/Foo-composition.uvue
index 6900569..85412a0 100644
--- a/pages/directive/v-bind/Foo-composition.uvue
+++ b/pages/directive/v-bind/Foo-composition.uvue
@@ -27,6 +27,7 @@ defineProps({
   },
   obj: {
     // #ifdef APP-ANDROID
+    // TODO: 确认类型是否合理
     type: FooPropsObj1ReactiveObject,
     // #endif
     // #ifdef APP-IOS || WEB
diff --git a/pages/directive/v-text/v-text.test.js b/pages/directive/v-text/v-text.test.js
index 548a35c..06d9d4e 100644
--- a/pages/directive/v-text/v-text.test.js
+++ b/pages/directive/v-text/v-text.test.js
@@ -4,7 +4,7 @@ const COMPOSITION_PAGE_PATH = '/pages/directive/v-text/v-text-composition'
 describe('v-text', () => {
   if (!process.env.uniTestPlatformInfo.startsWith('web')) {
     // TODO: 仅 web 支持
-    it('web', async () => {
+    it('not web', async () => {
       expect(1).toBe(1)
     })
     return
diff --git a/pages/reactivity/core/watch/watch-composition.uvue b/pages/reactivity/core/watch/watch-composition.uvue
index ba451d2..5e3a9e6 100644
--- a/pages/reactivity/core/watch/watch-composition.uvue
+++ b/pages/reactivity/core/watch/watch-composition.uvue
@@ -105,7 +105,6 @@ const stopWatchCount = watch(count, (count : number, prevCount : number, onClean
   // 侦听器在响应式依赖改变时立即触发
   flush: 'sync',
   // 响应属性或引用作为依赖项被跟踪时调用
-  // TODO: vue 3.4 开始, 数据更新,也会触发 onTrack, 待升级 vue 版本时,需要确认该变化是否合理及跟进
   onTrack(event : DebuggerEvent) {
     if (event.type === 'get') {
       watchCountTrackNum.value++
diff --git a/pages/reactivity/core/watch/watch-options.uvue b/pages/reactivity/core/watch/watch-options.uvue
index ea46b69..2f2064f 100644
--- a/pages/reactivity/core/watch/watch-options.uvue
+++ b/pages/reactivity/core/watch/watch-options.uvue
@@ -120,7 +120,6 @@
           // 侦听器在响应式依赖改变时立即触发
           flush: 'sync',
           // 响应属性或引用作为依赖项被跟踪时调用
-          // TODO: vue 3.4 开始, 数据更新,也会触发 onTrack, 待升级 vue 版本时,需要确认该变化是否合理及跟进
           onTrack(event : DebuggerEvent) {
             if (event.type === 'get') {
               self.watchCountTrackNum++
@@ -144,7 +143,6 @@
           // 侦听器在响应式依赖改变时立即触发
           flush: 'sync',
           // 响应属性或引用作为依赖项被跟踪时调用
-          // TODO: vue 3.4 开始, 数据更新,也会触发 onTrack, 待升级 vue 版本时,需要确认该变化是否合理及跟进
           onTrack(event : DebuggerEvent) {
             if (event.type === 'get') {
               self.watchCountTrackNum++
-- 
GitLab