-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
54 lines (50 loc) · 1.69 KB
/
index.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
45
46
47
48
49
50
51
52
53
54
<html>
<head>
<title>vue sample</title>
</head>
<body>
<div id = "app">
{{message}}
<my-global-component v-bind:test_world="message"></my-global-component>
<my-local-component></my-local-component>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script>
Vue.component('my-global-component',{
template : '<div>this is global component!!{{test_world}}</div>',
props : ['test_world']
});
var app = new Vue({
el : '#app',
components : {
'my-local-component' : {
template : '<div>this is my local component!{{localData}} / {{localData2}}</div>',
data : function(){
var localData = 'local data! 1 !!' ;
return {
localData,
localData2 : "local data 2!!"
}
}
}
},
data : {
message : 'hello Vue js!'
},
beforeCreate() {
console.log("before create");
},
created() {
console.log("created");
},
mounted() {
console.log("mounted");
this.message = 'Hello world';
},
updated() {
console.log("updated");
},
});
</script>
</body>
</html>