From a52794a50b3b5e64afe990df5de666a12e48ff97 Mon Sep 17 00:00:00 2001 From: VK <370725567@qq.com> Date: Wed, 7 Jun 2023 17:56:17 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91u-tabbar=20?= =?UTF-8?q?=E5=86=85=E9=83=A8=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/vk-uview-ui/components/u-tabbar/u-tabbar.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/uni_modules/vk-uview-ui/components/u-tabbar/u-tabbar.vue b/uni_modules/vk-uview-ui/components/u-tabbar/u-tabbar.vue index 121df51..9685af1 100644 --- a/uni_modules/vk-uview-ui/components/u-tabbar/u-tabbar.vue +++ b/uni_modules/vk-uview-ui/components/u-tabbar/u-tabbar.vue @@ -162,8 +162,10 @@ export default { if (this.hideTabBar) uni.hideTabBar(); // 获取引入了u-tabbar页面的路由地址,该地址没有路径前面的"/" let pages = getCurrentPages(); - // 页面栈中的最后一个即为项为当前页面,route属性为页面路径 - this.pageUrl = pages[pages.length - 1].route; + if (pages.length > 0) { + // 页面栈中的最后一个即为项为当前页面,route属性为页面路径 + this.pageUrl = pages[pages.length - 1].route; + } }, computed: { valueCom() { -- GitLab