我遇到类似TypeError登陆的错误。插槽未定义
<div className="notification" />
</header>
<main
style={
ready
? {}
: {
height: "100vh",
overflow: "hidden"
}
}>
<LandingLoader className={ready ? "fade-out" : ""} />
<ul
className="slots"
style={{
visibility: ready ? "visible" : "hidden"
}}>
{landing &&
landing.Slots.map((slot,index) => {
if (slot && !slot.removed) {
let fullWidth = "100%";
let maxWidth = 576;
let style = {};
style["width"] = fullWidth;
style["maxWidth"] = fullWidth;
style["height"] = slot.HeightPixel + "px";
return (
<li key={index} className="slots" style={style}>
<Slot slotItem={slot} slotIndex={index} />
</li>
);
}
})}
</ul>
</main>
</div>
答案 0 :(得分:0)
您可以为广告位添加另一个检查,例如
landing && landing.Slots && landing.Slots.map
也请检查是Slots
还是slots
。可能是拼写错误