From beb63304cb16ec51ea0afca2ff092cf4f1f13599 Mon Sep 17 00:00:00 2001
From: zhenyuWang <13641039885@163.com>
Date: Fri, 9 Aug 2024 14:44:23 +0800
Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BB=A3=E7=A0=81=E4=BC=98?=
 =?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../attrs/child-composition.uvue              | 21 +++----------------
 .../attrs/child-options.uvue                  | 21 +++----------------
 2 files changed, 6 insertions(+), 36 deletions(-)

diff --git a/pages/component-instance/attrs/child-composition.uvue b/pages/component-instance/attrs/child-composition.uvue
index b47ea22..7d1e0e5 100644
--- a/pages/component-instance/attrs/child-composition.uvue
+++ b/pages/component-instance/attrs/child-composition.uvue
@@ -28,29 +28,14 @@ defineProps({
 const attrs = useAttrs()
 
 const hasPropsAttr = computed(():boolean => {
-  // #ifdef APP-ANDROID
-  return attrs.has('val')
-  // #endif
-  // #ifndef APP-ANDROID
-  return !!attrs['val']
-  // #endif
+  return attrs['val'] != null
 })
 
 const hasEmitsAttr = computed(():boolean => {
-  // #ifdef APP-ANDROID
-  return attrs.has('childClick')
-  // #endif
-  // #ifndef APP-ANDROID
-  return !!attrs['childClick']
-  // #endif
+  return attrs['childClick'] != null
 })
 
 const hasClassAttr = computed(():boolean => {
-  // #ifdef APP-ANDROID
-  return attrs.has('class')
-  // #endif
-  // #ifndef APP-ANDROID
-  return !!attrs['class']
-  // #endif
+  return attrs['class'] != null
 })
 </script>
diff --git a/pages/component-instance/attrs/child-options.uvue b/pages/component-instance/attrs/child-options.uvue
index 99f1947..8a49b7b 100644
--- a/pages/component-instance/attrs/child-options.uvue
+++ b/pages/component-instance/attrs/child-options.uvue
@@ -26,28 +26,13 @@ export default {
   },
   computed: {
     hasPropsAttr(): boolean {
-      // #ifdef APP-ANDROID
-      return this.$attrs.has('val')
-      // #endif
-      // #ifndef APP-ANDROID
-      return !!this.$attrs['val']
-      // #endif
+      return this.$attrs['val'] != null
     },
     hasEmitsAttr(): boolean {
-      // #ifdef APP-ANDROID
-      return this.$attrs.has('childClick')
-      // #endif
-      // #ifndef APP-ANDROID
-      return !!this.$attrs['childClick']
-      // #endif
+      return this.$attrs['childClick'] != null
     },
     hasClassAttr(): boolean {
-      // #ifdef APP-ANDROID
-      return this.$attrs.has('class')
-      // #endif
-      // #ifndef APP-ANDROID
-      return !!this.$attrs['class']
-      // #endif
+      return this.$attrs['class'] != null
     }
   }
 }
-- 
GitLab