Skip to content

Commit 5e71ec5

Browse files
committed
test: 测试teleport组件
1 parent 413f82a commit 5e71ec5

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

packages/vue/example/teleport/App.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { h, Teleport } from '../../lib/vue3.esm.js'
2+
3+
export default {
4+
name: 'App',
5+
setup() {},
6+
render() {
7+
const Tele = h(
8+
Teleport,
9+
{ to: 'body' },
10+
h('div', { id: 'tem', style: { color: 'red' } }, 'teleport is here')
11+
)
12+
return h('div', { id: 'demo' }, [h('div', 'i an in demo container'), Tele])
13+
}
14+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>Document</title>
9+
</head>
10+
11+
<div id="app"></div>
12+
13+
<body>
14+
<script type="module">
15+
16+
import {createApp} from "../../lib/vue3.esm.js";
17+
import App from "./App.js";
18+
19+
const rootContainer = document.querySelector("#app");
20+
createApp(App).mount(rootContainer);
21+
</script>
22+
</body>
23+
24+
</html>

0 commit comments

Comments
 (0)