不知道为什么会报这样的错,页面能渲染出来,但就是会报错,求大佬帮忙
wxml里这样调用,info 是一个object
wxs里是这样写的
var GangInFo = {
data: function (value) {
var obj = value.userBase;
obj.company = value.companyBase.name;
return obj;
}
}
module.exports = {
gang: GangInFo.data
}
var GangInFo = { data: function (value) { if (!value || !value.userBase|| !value.companyBase) { return {} } var obj = value.userBase; obj.company = value.companyBase.name; return obj; } } module.exports = { gang: GangInFo.data }
var obj = value?.userBase||{}; obj.company = value?.companyBase?.name;