Skip to content

Commit

Permalink
fix(types): allow slot attribute
Browse files Browse the repository at this point in the history
close #12617
  • Loading branch information
yyx990803 committed Jul 6, 2022
1 parent e244687 commit 94ccca2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions types/jsx.d.ts
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions types/test/v3/tsx-test.tsx
Expand Up @@ -51,3 +51,5 @@ const Foo = defineComponent({
// working
;<Foo bar={1} />
;<Foo bar={1} foo="baz" />

;<div slot="x" />

1 comment on commit 94ccca2

@chenqiongqiong
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Please sign in to comment.