【发布时间】:2017-02-12 03:13:10
【问题描述】:
我是 vue 新手,我一直在尝试解决控制台中关于无法读取 null 属性的警告。我试图在我的道具中设置一个默认值,但没有运气。我可以在:condition 中获取值,但在控制台中它显示警告 can't read property of null
props: ['user']
标题组件内部:
<header-tooltip :total="total" title="High Paying Cash Surveys" :user="user" :condition="user.hpcs" :currency="currency" placeholder="0"></header-tooltip>
警告:
[Vue warn]: Error when evaluating expression "user.hpcs": TypeError: Cannot read property 'hpcs' of null (found in component: <heading>)
【问题讨论】: