How to define component type manually? #1601
Answered
by
johnsoncodehk
kingyue737
asked this question in
Q&A
-
Anyone knows how to define component type manually? I want to define global component type for 3rd-party component which is written in js. The example in docs use
I can get intellisense of props and methods by
But how to add types of slots into |
Beta Was this translation helpful? Give feedback.
Answered by
johnsoncodehk
Jul 20, 2022
Replies: 2 comments 1 reply
-
Maybe
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Try: DefineComponent<
Props,
{},
{},
{},
Methods
> & new () => {
$slots: { // or $scopedSlots for vue 2
default: (_: { foo: any }) => VNode[]
}
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
kingyue737
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try: