-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex2.html
More file actions
51 lines (41 loc) · 1.14 KB
/
index2.html
File metadata and controls
51 lines (41 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<title>Test-vue-101</title>
</head>
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css" id="theme-styles">
<body>
<script type="importmap">
{
"imports": {
"vue": "https://unpkg.com/vue@3/dist/vue.esm-browser.js"
}
}
</script>
<div id="app"> <h1>{{ message }}</h1></div>
<hr>
<div id="appComponent">{{ message }}</div>
<hr>
<div id="appComponent2">{{ message }}</div>
<hr>
<script type="module">
import { createApp } from 'vue'
createApp({
data() {
return {
message: 'Hello Vue - index 2 -sample!'
}
}
}).mount('#app')
</script>
<script type="module">
import { createApp } from 'vue'
import MyComponent from './components/my-component.js'
import MyComponent2 from './components/my-component2.js'
//mount component1
createApp(MyComponent).mount('#appComponent')
//then Component 2
createApp(MyComponent2).mount('#appComponent2')
</script>
</body>
</html>