Vue.js props

강참치·2022년 5월 31일
0

Vue.js

목록 보기
1/2
post-thumbnail
  • 가능한 자세히 정의
  • type: String, Number, Boolean, Function, Object, Array, Symbol
ex)
props: {
	detail: {
	type: Object,
	default() {
		return {
			값들..
		}
	}
},
  status: {
    type: String,
    required: true,
    validator: function (value) {
      return [
        'syncing',
        'synced',
        'version-conflict',
        'error'
      ].indexOf(value) !== -1
    }
  }
}
  • props 는 카멜 케이스로 쓰고 바인드 해줄때는 케밥 케이스로
<WelcomeMessage greeting-text="hi"/>

props: {
  greetingText: String
}
profile
참치입니다

0개의 댓글