Vue · Middle · Question 28 of 75
Why render a modal with <Teleport to="body">?
- ✓Correct answer: To place its DOM at the end of
<body>so parentoverflow,z-indexortransformdon't clip it, while keeping it in the component tree - 2To load the modal from another server
- 3To render the modal only on the server
Explanation
Teleport changes only where the DOM goes; props, events and provide/inject still work as if the modal were in place.