Vue.js defineProps

Jmnote (토론 | 기여)님의 2023년 10월 13일 (금) 12:38 판

1 개요

Vue.js defineProps
const props = defineProps({
  foo: String
})
const props = defineProps<{
  foo: string
  bar?: number
}>()
export interface Props {
  msg?: string
  labels?: string[]
}

const props = withDefaults(defineProps<Props>(), {
  msg: 'hello',
  labels: () => ['one', 'two']
})

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}