-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlearn-node.html
More file actions
51 lines (51 loc) · 1003 Bytes
/
learn-node.html
File metadata and controls
51 lines (51 loc) · 1003 Bytes
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div>
<h1>MY INFO</h1>
<div id="info">
<my-info :infoData="infoData"></my-info>
</div>
</div>
<script src="../../common/jquery.min.js"></script>
<script src="../../common/vue.min.js"></script>
<script>
function loadMyInfoData(){
$.ajax({
type: "get",
url: "127.0.0.1:8888",
dataType: "json",
success: function(resp){
loadMyInfoDom(resp.data);
},
error: function (resp){
alert(resp.msg)
}
});
}
function loadMyInfoDom(infoData){
Vue.component({
template:
"<span>{{infoData.name}}</span>"
+"<span>{{infoData.id}}</span>",
props: {
infoData: Object
}
data: function(){
return {}
},
});
var myInfoVm= new Vue({
el: "#info",
data: {
infoData: infoData
}
});
}
</script>
</body>
</html>