-
Notifications
You must be signed in to change notification settings - Fork 0
/
組件.html
44 lines (43 loc) · 982 Bytes
/
組件.html
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
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="https://cdn.bootcss.com/vue/2.3.4/vue.js"></script>
<!-- <script src="https://unpkg.com/[email protected]/dist/axios.min.js"></script> -->
<!-- <script src="https://unpkg.com/[email protected]/lodash.min.js"></script> -->
</head>
<body>
<script>
Vue.component('my-component', {
template: '<div>A custom component!</div>'
})
</script>
<div id="example">
<my-component></my-component>
</div>
<script>
var child1 = {
template:'<div>a child1 component!</div>'
}
var child2 = {
template:'<div>a child2 component!</div>'
}
window.onload =function(){
new Vue({
el: '#example'
});
new Vue({
el:"#demo",
components:{
child1,
child2
}
})
}
</script>
<div id="demo">
<child1></child1>
<child2></child2>
</div>
</body>
</html>