8***@qq.com
8***@qq.com
  • 发布:2021-04-13 17:11
  • 更新:2021-04-13 17:11
  • 阅读:368

【报Bug】空字符串赋值为数字0和布尔false时结果还是空字符串

分类:uni-app

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

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 3.1.8

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

基础库版本号: 2.16.0

项目创建方式: HBuilderX

示例代码:

<template>
<view>
<!-- 编辑页 -->
{{orderType}}
{{orderType2}}
{{orderType3}}
<!-- {{$store.state.orderType}} -->
</view>
</template>

<script>
export default {
data() {
return {
orderType: '',
orderType2: '',
orderType3: '',
}
},
methods: {

    },  
    onLoad() {  
        console.log(this.$store.state.orderType)  
        // this.orderType = this.$store.state.orderType;  
        this.orderType2 = 0;  
        this.orderType3 = false;  

    },  
}  

</script>

<style>

</style>

操作步骤:

<template>
<view>
<!-- 编辑页 -->
{{orderType}}
{{orderType2}}
{{orderType3}}
<!-- {{$store.state.orderType}} -->
</view>
</template>

<script>
export default {
data() {
return {
orderType: '',
orderType2: '',
orderType3: '',
}
},
methods: {

    },  
    onLoad() {  
        console.log(this.$store.state.orderType)  
        // this.orderType = this.$store.state.orderType;  
        this.orderType2 = 0;  
        this.orderType3 = false;  

    },  
}  

</script>

<style>

</style>

预期结果:

orderType2为0,orderType3为false

实际结果:

orderType2为‘’,orderType3为‘’

bug描述:

开发微信小程序时碰到的,就离谱,不知道是这边的问题还是小程序那边的问题

2021-04-13 17:11 负责人:无 分享
已邀请:

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