Skip to content
masterclass Buddy

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.

Subscribe
  • <script setup>
  • useTemplateRef()
  • template refs
  • props
  • emits
  • $parent

Source: <script setup> | Vue.js. Checked 2026-11-03.