Skip to content

Why Vue doesn't append a class if I use <teleport> in a component? #7763

Closed Answered by Hiws
szulcus asked this question in Help/Questions
Discussion options

You must be logged in to vote

Because the class is being added to the root component, which in this case is <Teleport> and not<div class="modal">.
Turn off inherritance with inheritAttrs: false and bind the attributes manually to the div <div class="modal" v-bind="$attrs">

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
Answer selected by szulcus
Comment options

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