Under computed I use
...mapGetters({
'employeeRenderData': 'getEmployeeRenderData',
})
When calling
value: t.employeeRenderData.employeeSum //可以调到
but
value: t.employeeRenderData.employeeSum.total //就会报错
Cannot read property 'total' of undefined
在template中{{这里面调用也是同样的问题 求大神帮忙}}
value: t.employeeRenderData.employeeSum && t.employeeRenderData.employeeSum.total
Maybe employeeSum does not exist when you initially call employeeSum.total, and an error will be reported when you call employeeSum.total. Just make fault tolerance