132liyh
132liyh
  • 发布:2025-07-07 15:28
  • 更新:2025-07-07 15:31
  • 阅读:454

【报Bug】 uniapp vue3 微信小程序 编译模式中的启动参数如果有一个是布尔类型,传入进来会全部变成true 但是再路由栈是又是正常的

分类:uni-app

产品分类: uniapp/小程序/微信

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: Windows 10 专业版 22H2

HBuilderX类型: 正式

HBuilderX版本号: 4.66

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

基础库版本号: 上到最新,下到2.16.1

项目创建方式: HBuilderX

示例代码:

const props = defineProps({
index: {
type: Number,
default: 0
},
isCase: {
type: Boolean,
default: false
}
})

console.log(props);

console.log(getCurrentPages().pop());

操作步骤:

const props = defineProps({
index: {
type: Number,
default: 0
},
isCase: {
type: Boolean,
default: false
}
})

console.log(props);

console.log(getCurrentPages().pop());

预期结果:

参数值接收正确

实际结果:

参数值接收异常

bug描述:

const props = defineProps({  
    index: {  
        type: Number,  
        default: 0  
    },  
    isCase: {  
        type: Boolean,  
        default: false  
    }  
})

//这是传入的参数index=1&isCase=false

这是接收到的参数Proxy {index: 1, isCase: true} 会出现isCase全是true

这个是路由栈getCurrentPages()中获取到的options: {index: "1", isCase: "false"}

2025-07-07 15:28 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

你这个编译模式的参数,是在微信小程序开发者工具中设置的吗?

  • 132liyh (作者)

    对的

    2025-07-21 14:55

要回复问题请先登录注册