-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
80 lines (80 loc) · 2.31 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
.list-title {
font-weight: bold;
}
.list-time {
font-style: italic;
}
</style>
</head>
<body>
<div id="div1" class="div">
{{ title.substring(0, 1) }}
<!-- 列表 -->
<ul>
<li class="list-item" k-for="i in list" style="color: black; font-size: 20px;">
<h3 class="list-title">{{ i.title }}</h3> - <em class="list-time">{{ i.time }} </em>
</li>
</ul>
</div>
<span id="loading">loading</span>
<script src="./dist/bundle.js"></script>
<script>
var spn = document.getElementById("loading");
var kmv = new Kmv({
el: '#div1',
data: {
name: "kelen"
},
beforeInit: function (event) {
setTimeout(function() {
// 模拟ajax获取数据
var data = {
title: "书名",
list: [{
title: "xxmmcc",
time: new Date()
}, {
title: "wordSpacing",
time: new Date()
},{
title: "wordSpacing",
time: new Date()
},{
title: "wordSpacing",
time: new Date()
},{
title: "wordSpacing",
time: new Date()
},{
title: "wordSpacing",
time: new Date()
},{
title: "wordSpacing",
time: new Date()
},{
title: "wordSpacing",
time: new Date()
},{
title: "wordSpacing",
time: new Date()
}]
}
spn.style.display = "none";
// 触发initData事件
event.$emit("initData", data);
kmv.data.list.splice(1, 1, {title: "222", time: new Date()})
}, 1000)
},
mounted: function() {
console.log("finish");
}
});
</script>
</body>
</html>