vue-lynx / defineExpose

Function: defineExpose()

function defineExpose<Exposed>(exposed?): void

Vue <script setup> compiler macro for declaring a component's exposed instance properties when it is accessed by a parent component via template refs.

<script setup> components are closed by default - i.e. variables inside the <script setup> scope is not exposed to parent unless explicitly exposed via defineExpose.

This is only usable inside <script setup>, is compiled away in the output and should not be actually called at runtime.

Type Parameters

Type ParameterDefault type
Exposed extends Record<string, any>Record<string, any>

Parameters

ParameterType
exposed?Exposed

Returns

void

See

https://vuejs.org/api/sfc-script-setup.html#defineexpose

Defined in

node_modules/.pnpm/@vue+runtime-core@3.5.30/node_modules/@vue/runtime-core/dist/runtime-core.d.ts:248