Subscribe on changes!

Make defineSlots' type stricter

avatar
Jun 26th 2023

What problem does this feature solve?

Currently defineSlots accepts these types:

{
  default: (foo: string) => any
  foo: (props: { foo: string }) => any
}

Volar supports both. However, only form 2 is valid since we can pass named parameters to slots only.

What does the proposed API look like?

Allow (props: Record<string, unknown>) => any only.

I'm willing to contribute

avatar
Jun 27th 2023

My fault. We can use v-bind actully.