Skip to content
Discussion options

You must be logged in to vote

Thanks for answer.

My final solution is like this:

export function message(options: MessageProps & { duration?: number }, children?: Record<string, () => VNodeChild>) {
  // insert <Message .../>
}

function onClick(){
  // <Message class="bg" :duration="3"><div>{ msg.value }</div></Messgae>
  message({duration: 3, class: "bg"}, { default: () => <div>{ msg.value }</div> })
}

Because I also found a [Vue wrarn] and it is not only ts issue. So I replace ref-prop with slot. It works and has no warning.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by boobam22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants