![]() | 1 Lqxc 2022-09-14 14:55:04 +08:00 via Android 还需要点上下文 |
![]() | 2 cyrbuzz 2022-09-14 14:57:42 +08:00 XXX.specs?.item?.type === 'array'。 |
![]() | 3 IvanLi127 2022-09-14 15:21:26 +08:00 要么你得先在前面加判断,判断出是 `XXX.specs` 是 `booleanDateType`;要么直接把 `XXX.specs` 强转成 `booleanDateType`。 |
5 Leviathann 2022-09-14 15:28:39 +08:00 stringDateType 怎么定义的? |
6 renmu 2022-09-14 16:59:22 +08:00 via Android //@ts-ignore |
![]() | 7 xutao881 2022-09-14 17:04:26 +08:00 ``` x?.x?.x?.item ``` 可解 99% 的 not exist 问题 |
![]() | 8 particlec OP const arr = XXX.specs as ArrDateType;定死类型就行了 |
9 PerFectTime 2022-09-14 17:54:27 +08:00 //@ts-ignore 手动狗头 |