From a0cd00b09c65ba437d1723656ec0a4caa90b2eaa Mon Sep 17 00:00:00 2001 From: jixinbao Date: Tue, 23 Jul 2024 21:07:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=89=E5=8D=93?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=B1=BB=E5=9E=8B=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component-instance/data/data-composition.uvue | 5 ++--- pages/component-instance/data/data-options.uvue | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pages/component-instance/data/data-composition.uvue b/pages/component-instance/data/data-composition.uvue index 098a9db..87c99f4 100644 --- a/pages/component-instance/data/data-composition.uvue +++ b/pages/component-instance/data/data-composition.uvue @@ -51,14 +51,13 @@ arr: [4, 5, 6] }) - const refElement = ref(null) + const refElement = ref(null) const refElementIsSame = ref(false) const refTest = () => { - console.log(instance.proxy); const queryElementById1 = uni.getElementById('idRef') const queryElementById2 = uni.getElementById('idRef') - const htmlRefElement = instance.$refs.htmlRef + const htmlRefElement = instance.$refs['htmlRef'] as UniElement | null; refElement.value = htmlRefElement if (queryElementById1 === queryElementById2 && queryElementById1 === htmlRefElement diff --git a/pages/component-instance/data/data-options.uvue b/pages/component-instance/data/data-options.uvue index 101ac42..2ecd2f2 100644 --- a/pages/component-instance/data/data-options.uvue +++ b/pages/component-instance/data/data-options.uvue @@ -59,7 +59,7 @@ refTest() { const queryElementById1 = uni.getElementById('idRef') const queryElementById2 = uni.getElementById('idRef') - const htmlRefElement = this.$refs.htmlRef + const htmlRefElement = this.$refs['htmlRef'] as UniElement; this.refElement = htmlRefElement if (queryElementById1 === queryElementById2 && queryElementById1 === htmlRefElement -- GitLab