본문 바로가기
  • 어서오세요.
  • 안녕하세요~
카테고리 없음

type script에서 undefind 일 경우 처리하기

by ozero 2024. 6. 30.

최초에

action.selectPlanInfo.price

 

으로 작성하니 type 에러가 나서 아래와 같이 수정

 

menu.totolMoney = menu.totalMenuCount * (action.selectPlanInfo?.price ?? 0);