Skip to content

defineComponent had type error  #8608

Open
@mengdaoshizhongxinyang

Description

@mengdaoshizhongxinyang

Vue version

3.3.4

Link to minimal reproduction

https://www.typescriptlang.org/play?ssl=7&ssc=2&pln=1&pc=1#code/JYWwDg9gTgLgBAbzgEwKYDNgDtUGELgQ5YwA0AFqQMqowCuY+JqAHmVQDYQwDOAKgE8wqOAF846KATgAiAG51UMgFABjIj3j5wAXjSYc2yMRgAKZXEtwA9NZhCRqKFKgWrpsFLA8AXAlGkqjAsPjT0jEQwrDAAPADaALrUXLyCwjEI6BAQPppQ2ADmogB8xQCUOsUIblZWULR0UFhwphXF5KYA5MjAcp1lNWLKZUA

Steps to reproduce

//

What is expected?

//type error
defineComponent(
    (props:{},ctx:SetupContext<[],SlotsType<{foo:string}>>)=>{
        return ()=>h('div')
    }
)

What is actually happening?

Type '{ attrs: Data; slots: Readonly<InternalSlots>; emit: (event: string, ...args: any[]) => void; expose: (exposed?: Record<string, any> | undefined) => void; }' is not assignable to type '{ attrs: Data; slots: Readonly<{ foo: Slot<string>; }>; emit: (event: never, ...args: any[]) => void; expose: (exposed?: Record<string, any> | undefined) => void; }'.

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions