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 121df5110f12a2e2494cd5ed146384846d2cf722..9685af162f7949256100452737f0708edfa5b859 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() {