【uni-app框架】组件传参props传入对象之后报的错误:undefined is not an object (evaluating 'event.detail.$parent.$childre

错误的核心代码:undefined is not an object (evaluating 'event.detail.$parent.$children'); [Component] Event Listener Error @ wx-view#(anonymous)

 

错误分析:出现这个的原因其实就是父组件传入的数据类型结构和子组件传入的数据结构不一致,而导致undefined 错误类型:

 

还有一个特殊情况:计算属性传入props传参的时候,如果对象稍微复杂点【如:[{}]】类型之后,直接计算属性传入参数也会报underfined错误,但是在data中做一个初始化之后如:wallet:[{}] 之后,计算属性在计算会发现正常【总而言之,APP端太多的问题了,所以各种用法还是不断测试保守用即可----毕竟Vue还是专门为H5开发的,所以app只能将就!】

 

 

【uni-app框架】组件传参props传入对象之后报的错误:undefined is not an object (evaluating 'event.detail.$parent.$childre_第1张图片

【uni-app框架】组件传参props传入对象之后报的错误:undefined is not an object (evaluating 'event.detail.$parent.$childre_第2张图片

 

错误代码:09:40:58.561 thirdScriptError
09:40:58.581 undefined is not an object (evaluating 'event.detail.$parent.$children'); [Component] Event Listener Error @ wx-view#(anonymous)
09:40:58.602 handleLink@(global function):23179:27
09:40:58.623 (global function):8:578123
09:40:58.643 safeCallback@(global function):8:423231
09:40:58.664 call@(global function):8:423120
09:40:58.684 n@(global function):8:426120
09:40:58.704 (global function):8:426699
09:40:58.724 p@(global function):8:425664
09:40:58.744 dispatchEvent@(global function):8:426596
09:40:58.765 triggerEvent@(global function):8:426811
09:40:58.785 triggerEvent@(global function):8:503134
09:40:58.806 triggerLink@(global function):23169:26
09:40:58.827 ready@(global function):23777:20
09:40:58.848 safeCallback@(global function):8:423231
09:40:58.872 call@(global function):8:423120
09:40:58.890 triggerLifeTime@(global function):8:521073
09:40:58.910 (global function):8:569273
09:40:58.930 (global function):8:564192
09:40:58.952 (global function):8:567180
09:40:58.973 (global function):8:566454
09:40:58.994 n@(global function):8:170241
09:40:59.013 subscribeHandler@(global function):8:1563
09:40:59.033 (global function):7:81164
09:40:59.055 (global function):7:81185
09:40:59.077 B@(global function):7:4462
09:40:59.094 (global function):7:83747
09:40:59.114 consume@(weex framework):1:20313
09:40:59.134 map@[native code]
09:40:59.155 (weex framework):1:178111
09:40:59.175 thirdScriptError
09:40:59.196 null is not an object (evaluating 'ret[0].width');at App onError function;at SelectorQuery callback function
09:40:59.216 (global function):36396:43
09:40:59.236 (global function):8:346768
09:40:59.257 (global function):8:95330
09:40:59.278 r@(global function):8:346812
09:40:59.308 (global function):8:343984
09:40:59.319 n@(global function):8:170241
09:40:59.341 subscribeHandler@(global function):8:1563
09:40:59.360 (global function):7:81164
09:40:59.380 (global function):7:81185
09:40:59.401 B@(global function):7:4462
09:40:59.421 (global function):7:83747
09:40:59.442 consume@(weex framework):1:20313
09:40:59.467 map@[native code]
09:40:59.486 (weex framework):1:178111

你可能感兴趣的:(uni-app)