vue-lynx / defineSlots

Function: defineSlots()

function defineSlots<S>(): StrictUnwrapSlotsType<SlotsType<S>>

Vue <script setup> compiler macro for providing type hints to IDEs for slot name and slot props type checking.

Example usage:

const slots = defineSlots<{
  default(props: { msg: string }): any
}>()

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
S extends Record<string, any>Record<string, any>

Returns

StrictUnwrapSlotsType<SlotsType<S>>

See

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

Defined in

node_modules/.pnpm/@vue+runtime-core@3.6.0-beta.17/node_modules/@vue/runtime-core/dist/runtime-core.d.ts:278