diff --git a/pages/template/long-list/long-list.uvue b/pages/template/long-list/long-list.uvue index 678346b604a4f3c95d4adfbdbfdb829900f17eb6..76874d5830d538b09ceee84c6cfd20cd42d35321 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 9babf4e22d698677b3a287ec2cf23b932b7edeff..eb8e51ef3c9edeff8ea972bae44cef82053de8f1 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) }) },