forked from nickshang/JavaScriptNote
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path11.foreach11.html
More file actions
65 lines (51 loc) · 2 KB
/
11.foreach11.html
File metadata and controls
65 lines (51 loc) · 2 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="../lib/knockout/dist/knockout.js"></script>
<script type="text/javascript">
var sidebarNavList = [
{
navTitle: "我的课表",
courseList: [
{ curIndex: 1, name: '待上课节', url: '/icourse/index.vpage#/schedule_plan/a' },
{ curIndex: 2, name: '历史课节', url: '/icourse/index.vpage#/schedule_ed/a' }
]
},
{
navTitle: "作业管理",
courseList: [
{ curIndex: 3, name: '布置作业', url: '/homework/assign/list.vpage' },
{ curIndex: 4, name: '检查作业', url: '/homework/check/list.vpage' }
]
},
{
navTitle: "学习报告",
courseList: [
{ curIndex: 5, name: '课节报告', url: '' },
{ curIndex: 6, name: '课程报告', url: '' }
]
},
];
// var shows = ko.observable([false,false,false]);
// var show = function(index){
// for(var i = 0; i < sidebarNavList.length; i++){
// shows()[i](sidebarNavList[index]["navTitle"].indexOf(self.data.appName) = -1);
// }
// }
var viewModel = {
shows: ko.observable([false,false,false]);,
show: function(index){
for(var i = 0; i < sidebarNavList.length; i++){
shows()[i](sidebarNavList[index]["navTitle"].indexOf(self.data.appName) = -1);
}
}
};
ko.applyBindings(viewModel);
</script>
</head>
<body>
<h1 data-bind="text: city"> </h1>
</body>
</html>