object 안에서 2개 이상의 타입 정하기

ooz·2021년 6월 29일
0

typescript

목록 보기
1/2

보통 변수면 아래처럼 하겠지만

let a: string | number;

object 안에서는 어떻게 할까?

data() {
  return {
    age: 25 as string | number  
  }
}
profile
사는 것도 디버깅의 연속. feel lucky to be different🌈 나의 작은 깃허브는 https://github.com/lyj-ooz

0개의 댓글