vuejs-challenges
vuejs-challenges copied to clipboard
13 - DOM传送门
// 你的答案
<script setup>
import { Teleport } from 'vue';
const msg = 'Hello World';
</script>
<template>
<!-- Renders it to a child element of the `body` -->
<Teleport to="body">
<span>{{ msg }}</span>
</Teleport>
</template>