5***@qq.com
5***@qq.com
  • 发布:2019-01-30 17:31
  • 更新:2019-01-30 17:35
  • 阅读:11982

uni-app页面使用了自定义组件,但是在向子组件传值的时候始终无法成功

分类:uni-app

我的具体代码实现:
页面中

<view class="content">  
       <waller-components :blanceMoney="blanceMoney" ref="wallerComponents" @clickButton="clickButton"></waller-components>  
</view>
import wallerComponents from "../../components/wallerComponents/wallerComponents.vue";  

export default {  

        components:{  
           'waller-components':wallerComponents  
        },  
        data() {  
            return {  
                blanceMoney:1200  
            }  
        },

子组件中接收值:
props:{
balanceMoney: {
type:Number,
default:100
}
},

最后的问题就是balanceMoney这个值始终都是默认值显示100,不会显示页面绑定传过来的1200. 这个我看在uni-app的模板例子里面是可以实现的。 我就不知道我是哪里写错了还是怎么了,实在找不到问题的错误点了, 希望有知道的小伙伴给点提示和意见

2019-01-30 17:31 负责人:无 分享
已邀请:
5***@qq.com

5***@qq.com (作者) - 掉坑里了

解决了,是我自己把blanceMoney,在子组件props中写成了balanceMoney。

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