Vue Built-In components (내장 컴포넌트)

YuJin Lee·2021년 12월 28일
0

https://v3.ko.vuejs.org/api/built-in-components.html

component

동적 컴포넌트를 렌더링 하기위한 "메타 컴포넌트" 입니다.
렌더링 할 실제 컴포넌트는 is prop에 의해 결정됩니다.
문자열로서의 is prop는 HTML 태그 이름 또는 컴포넌트 이름 일 수 있습니다.

<!-- vm의 `componentId` 속성에 의해 제어되는 동적 컴포넌트 -->
<component :is="componentId"></component>

<!-- 동적 컴포넌트는 등록된 컴포넌트나 prop로 전달된 컴포넌트를 렌더링할 수도 있습니다. -->
<component :is="$options.components.child"></component>

<!-- 동적 컴포넌트는 문자열로 컴포넌트를 참조할 수 있습니다. -->
<component :is="condition ? 'FooComponent' : 'BarComponent'"></component>

<!-- 동적 컴포넌트는 네이티브 HTML 엘레멘트를 렌더링하는데 사용될 수 있습니다. -->
<component :is="href ? 'a' : 'span'"></component>
profile
배운 것을 기록하는 곳 💻🙂

0개의 댓글