From b26dad14d6c55e024eb3349da48d349bad76a741 Mon Sep 17 00:00:00 2001 From: Anne_LXM <54163582+anne-lxm@users.noreply.github.com> Date: Fri, 26 Jan 2024 14:49:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4Element=E4=B8=BAUniElement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/template/drop-card/card/card.uvue | 4 ++-- pages/template/pull-zoom-image/pull-zoom-image.uvue | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/template/drop-card/card/card.uvue b/pages/template/drop-card/card/card.uvue index ff118bdd..a596542a 100644 --- a/pages/template/drop-card/card/card.uvue +++ b/pages/template/drop-card/card/card.uvue @@ -21,7 +21,7 @@ export default { data() { return { - $elementMap: new Map(), + $elementMap: new Map(), x: 0 as number, y: 0 as number, // 飘走的卡片计数 @@ -88,7 +88,7 @@ } else { // console.log('直接拿'); } - element?.style?.setProperty(propertyName, propertyStyle); + element.style.setProperty(propertyName, propertyStyle); }, touchstart(e : TouchEvent) { // console.log('touchstart') diff --git a/pages/template/pull-zoom-image/pull-zoom-image.uvue b/pages/template/pull-zoom-image/pull-zoom-image.uvue index e789f37b..b0fe1006 100644 --- a/pages/template/pull-zoom-image/pull-zoom-image.uvue +++ b/pages/template/pull-zoom-image/pull-zoom-image.uvue @@ -38,7 +38,7 @@ export default { data() { return { - $elementMap: new Map() + $elementMap: new Map() } }, methods: { @@ -64,10 +64,10 @@ }, // 工具方法,用于快速设置 Element 的 style setElementStyle(refName : string, propertyName : string, propertyStyle : any) : void { - let element : Element | null = (this.$data['$elementMap'] as Map).get(refName) + let element : UniElement | null = (this.$data['$elementMap'] as Map).get(refName) if (element == null) { element = this.$refs[refName] as UniElement; - (this.$data['$elementMap'] as Map).set(refName, element) + (this.$data['$elementMap'] as Map).set(refName, element) } element.style.setProperty(propertyName, propertyStyle); }, -- GitLab