Skip to content

vue.js 부모컴포넌트에서 자식컴포넌트로 데이터 전달방법 #4

Description

@pinest94

부모컴포넌트 : ProductDetail.vue
자식컴포넌트 : ProductReview.vue

ProductDetail.vue 코드 일부

<product-review v-bind:productName="product.name"></product-review> -------> 부모에서 자식으로 전달 방식

ProductReview.vue 코드 일부

props: ['productName'] -------> <script>내부에 작성(자식이 부모의 데이터를 받는 방식)
<div>{{ productName }}</div> ---------> 받아온 데이터 사용

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions