From 395fc4f167178825757eead0a71ad6ad75747711 Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Wed, 11 Sep 2024 17:03:35 +0800 Subject: [PATCH] refactor(uni-stat): remove ts-ignore --- uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts b/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts index 5b4d211e..76683d7a 100644 --- a/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts +++ b/uni_modules/uni-stat/utssdk/common/utils/pageInfo.uts @@ -227,12 +227,10 @@ export const get_page_name = (routepath : string) : string => { let page_now = pages.find((p): boolean => p.route == routepath) if (page_now == null) { return '' - } - // @ts-ignore + } page = page_now.vm! } - - // @ts-ignore + const pageStyle = (page.$page as UniPage).getPageStyle() const titleText = pageStyle['navigationBarTitleText'] ?? '' return titleText as string @@ -247,8 +245,7 @@ export const get_page_vm = () : Page | null => { return null } let page = pages[pages.length - 1] - // TODO 正常来说,调用当前方法的地方只在 生命周期内,数组内最少会有一个页面,所以理论上是不存在获取不到的情况的 - // @ts-ignore + // TODO 正常来说,调用当前方法的地方只在 生命周期内,数组内最少会有一个页面,所以理论上是不存在获取不到的情况的 return page.vm } -- GitLab