zhangdaren
zhangdaren
  • 发布:2019-10-31 17:30
  • 更新:2019-11-01 11:30
  • 阅读:1472

百度小程序,给子组件传Boolean值时,会识别为string

分类:uni-app

本来想发bug的,但一想这个应该是百度小程序的问题

微信小程序、头条小程序都是ok的,唯独百度小程序出问题了,见截图:

代码如下:

<template>  
    <view class="">  
        <noticebar scrollable="true"></noticebar>  
    </view>  
</template>  

<script>  
    import noticebar from "../../coponents/noticebar/index.vue";  

    export default {  
        data() {  
            return {};  
        },  
        components: {  
            noticebar  
        },  
    };  
</script>

经过测试,修改为下面的代码就可以正常:

<template>  
    <view class="">  
        <noticebar :scrollable="scrollable"></noticebar>  
    </view>  
</template>  

<script>  
    import noticebar from "../../coponents/noticebar/index.vue";  

    export default {  
        data() {  
            return {  
                scrollable:true  
            };  
        },  
        components: {  
            noticebar  
        },  
    };  
</script>

重现项目:

2019-10-31 17:30 负责人:无 分享
已邀请:
陈晨1

陈晨1

改为<noticebar :scrollable="true"></noticebar>即可

  • zhangdaren (作者)

    谢谢,原来这样弄。。。

    2019-11-01 11:32

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