From fdf81880901d295974cb01c0011d21e0f3cc6c71 Mon Sep 17 00:00:00 2001 From: hdx Date: Tue, 29 Aug 2023 17:15:57 +0800 Subject: [PATCH] =?UTF-8?q?swiper-list,long-list:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=AD=A6=E5=91=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/template/long-list/long-list.uvue | 8 ++++---- pages/template/swiper-list/swiper-list.uvue | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/template/long-list/long-list.uvue b/pages/template/long-list/long-list.uvue index 678346b6..76874d58 100644 --- a/pages/template/long-list/long-list.uvue +++ b/pages/template/long-list/long-list.uvue @@ -79,8 +79,8 @@ } }, onReady() { - this.$headerHeight = (this.$refs["header"] as INode)?.offsetHeight as number - this.$swiperWidth = (this.$refs["swiper"] as INode)?.offsetWidth as number + this.$headerHeight = (this.$refs["header"] as INode).offsetHeight + this.$swiperWidth = (this.$refs["swiper"] as INode).offsetWidth this.queryTabItemsSize() this.setSwiperIndex(0, true) }, @@ -117,8 +117,8 @@ const tabs = this.$refs["swipertab"] as INode[] tabs.forEach((node) => { this.$swiperTabsRect.push({ - left: node.offsetLeft as number, - width: node.offsetWidth as number + left: node.offsetLeft, + width: node.offsetWidth } as SwiperTabsItem) }) }, diff --git a/pages/template/swiper-list/swiper-list.uvue b/pages/template/swiper-list/swiper-list.uvue index 9babf4e2..eb8e51ef 100644 --- a/pages/template/swiper-list/swiper-list.uvue +++ b/pages/template/swiper-list/swiper-list.uvue @@ -55,7 +55,7 @@ } }, onReady() { - this.$swiperWidth = (this.$refs["swiper"] as INode)!.offsetWidth! as number + this.$swiperWidth = (this.$refs["swiper"] as INode).offsetWidth this.queryTabItemsSize() this.setSwiperIndex(0, true) }, @@ -90,8 +90,8 @@ const tabs = this.$refs["swipertab"] as INode[] tabs.forEach((node) => { this.$swiperTabsRect.push({ - left: node.offsetLeft as number, - width: node.offsetWidth as number + left: node.offsetLeft, + width: node.offsetWidth } as SwiperTabsItem) }) }, -- GitLab