docs icon indicating copy to clipboard operation
docs copied to clipboard

TypeScript documentation not updated for vue 3.3 typed slots

Open swantzter opened this issue 2 years ago • 5 comments

vuejs/core#7982 introduced typing of slots, and it was announced in the release post, however I can't find anything in the docs on how to use this new feature, not in the slots documentation neither in the TypeScript (composition / options) sections, the only information I found on how to use this new feature was in the PR itself.

It would be nice to get this added to the docs

swantzter avatar May 17 '23 10:05 swantzter

The docs mention it here: https://vuejs.org/api/sfc-script-setup.html#defineslots

But might be good to create a cross reference at the places you mentioned...

SimonSimCity avatar May 17 '23 10:05 SimonSimCity

Yeah, after searching a bit more I see the options API version is also available at https://vuejs.org/api/options-rendering.html#slots but neither this one nor the one you mentioned comes near the top when you use the search and search for "slots", or is linked to in those pages

swantzter avatar May 17 '23 10:05 swantzter

what about example with no props ?

volarname avatar May 29 '23 08:05 volarname

also looks like current code is mistake documentation:

default(props: { msg: string }): any

should be:

default?: (props: { msg: string }) => any

or?

volarname avatar May 29 '23 08:05 volarname

also looks like current code is mistake documentation:

default(props: { msg: string }): any

should be:

default?: (props: { msg: string }) => any

or?

Both are valid syntax. Please refer to PR for more details.

Use default?: (props: any) => any for no props.

jd-solanki avatar May 29 '23 09:05 jd-solanki