By default, everything in $attrs will be automatically inherited on the component's root element if there is only a single root element. This behavior is disabled if the component has multiple root nodes, and can be explicitly disabled with the inheritAttrs option.
attr는 props나 emit으로 미쳐 받지 못한 속성들을 모두 잡아준다. 명시적으로 모두 정의하기 어려운 속성들을 가져오거나, 다시 자신의 자식에게 드릴링 할때 유용하다.
<template>
<child-component type="text"
placeholder="Enter your name" />
</template>
Subscribe to my site to be the first to receive notifications and emails about the latest updates, including new posts.
Join Slashpage and subscribe to 'Yejun Cheon'!