fix(types): allow slot attribute

close #12617
This commit is contained in:
Evan You 2022-07-06 11:17:33 +08:00
parent e244687135
commit 94ccca207c
2 changed files with 8 additions and 0 deletions

6
types/jsx.d.ts vendored
View File

@ -1303,6 +1303,12 @@ type EventHandlers<E> = {
type ReservedProps = {
key?: string | number | symbol
ref?: VNodeData['ref']
/**
* @deprecated Old named slot syntax has been deprecated, use the new syntax
* instead: `<template v-slot:name>`
* https://v2.vuejs.org/v2/guide/components-slots.html#Named-Slots
*/
slot?: string
}
type ElementAttrs<T> = T & ReservedProps

View File

@ -51,3 +51,5 @@ const Foo = defineComponent({
// working
;<Foo bar={1} />
;<Foo bar={1} foo="baz" />
;<div slot="x" />