Vue.js · Function
defineExpose
defineExpose() controls which bindings in a <script setup> component a parent can access through a template ref. The component is private by default, so only explicitly exposed properties and methods are public.
Last updated
Syntax
defineExpose({ propertyOrMethod })In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
<script setup>useTemplateRef()template refspropsemits$parent