-
Props 관련 예제 및 실습VUE.JS 2020. 4. 26. 21:44
Props는 상위 컴포넌트에서 하위 컴포넌트로 데이터를 전달할 때 사용합니다.
props / Emit 관계 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title></head><body><div id="app"><app-header v-bind:propsdata="message"></app-header><app-header v-bind:propsdata="num"></app-header></div><script>appHeader = {template : '<h1>{{ propsdata }}</h1>',props : ['propsdata']},appContent ={template : '<h1>{{propsdata}}</h1>',props : ['propsdata']}new Vue({el : '#app',data : {message : "HI bins",num : 3},components : {'app-header' : appHeader,'app-content' : appContent}});</script></body></html>http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter'VUE.JS' 카테고리의 다른 글
emit & props를 이용한 같은 레벨의 component 데이터 통신 (0) 2020.04.30 emit 개념 관련 정리 (0) 2020.04.30 지역컴포넌트 - 전역컴포넌트 관련 정리 (0) 2020.04.19 HELLO VUE .JS 이해하기 (0) 2020.04.18 Vue의 장점 - ReActivity (0) 2020.04.16