9***@qq.com
9***@qq.com
  • 发布:2021-11-09 22:02
  • 更新:2021-11-10 11:56
  • 阅读:973

【报Bug】使用switchTab切换页面,方法调用成功 但页面没有跳转

分类:uni-app

产品分类: uniapp/小程序/QQ

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: 21H2 22000.282

HBuilderX类型: 正式

HBuilderX版本号: 3.2.12

第三方开发者工具版本号: 0.3.4

基础库版本号: 1.6.3

项目创建方式: HBuilderX

操作步骤:

点击按钮

预期结果:

跳转到对应页面

实际结果:

方法调用成功,页面没有跳转

bug描述:

在home页面点击按钮按钮调用uni.switchTab,方法调用成功,但页面没有进行跳转。在开发者工具里不生效,真机测试没问题。
调用结果:调用成功 {errMsg: "switchTab:ok"}

<template>  
    <button @click="test">  
        test  
    </button>  
</template>  

<script>  
    export default{  
        methods:{  
            test(){  
                uni.switchTab({  
                    url:'/pages/main/index/index',  
                    success(res) {  
                        console.log('调用成功',res);  
                    }  
                })  
            }  
        }  
    }  
</script>

以下为pages.json配置代码。

 "tabBar": {  
        "color": "#909399",  
        "selectedColor": "#303133",  
        "backgroundColor": "#FFFFFF",  
        "borderStyle": "black",  
        "list": [{  
            "text": "角色",  
            "pagePath": "pages/main/index/index",  
            "iconPath": "",  
            "selectedIconPath": ""  
        },  {  
            "text": "我的",  
            "pagePath": "pages/main/home/home",  
            "iconPath": "",  
            "selectedIconPath": ""  
        }]  
    }
2021-11-09 22:02 负责人:jxtian 分享
已邀请:
jxtian

jxtian

这是QQ开发者工具的bug,0.3.1测试正常,0.3.4有这个问题

该问题目前已经被锁定, 无法添加新回复