不能调用可能是“未定义”的对象。ts(2722) Cannot invoke an object which is possibly ‘undefined‘.

在这里插入图片描述
解决:

 // 不能调用可能是“未定义”的对象。ts(2722) Cannot invoke an object which is possibly 'undefined'.
    let sl = ctx.slots?.slotzhu!()[0].children

猜你喜欢

转载自blog.csdn.net/weixin_45441173/article/details/131144725