songjun
2024-09-04 cc908053e0b5075fbfd27350b6da4b39bca9e550
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
@model sbcLabSystem.Models.Backstage.ShowPageViewModel
@{
    ViewBag.Title = ""; 
    Layout = "~/Views/Shared/Master.cshtml";
}
 
<script type="text/javascript">
    var viewModel;
    $(function () {
        viewModel = new myViewModel_Paper(@Html.Raw(Json.Encode(Model)));
        ko.applyBindings(viewModel, $(".paper")[0]);
        InitDateTimePicker(); 
    });
 
    function myViewModel_Paper(data) {
        var self = this;
        self.PageIndex = ko.observable(1);
        ko.mapping.fromJS(data, {}, self);
    }
</script>
 
 
<div class="paper container">
    <ul class="nav nav-pills" role="tablist">
        <li role="presentation" data-bind="css:{active:PageIndex()==1}"><a href="#">第一页</a></li>
        <li role="presentation" data-bind="css:{active:PageIndex()==2}"><a href="#">第二页</a></li>
        <li role="presentation" data-bind="css:{active:PageIndex()==3}"><a href="#">第三页</a></li>
        <li role="presentation" data-bind="css:{active:PageIndex()==4}"><a href="#">第四页</a></li>
        <li role="presentation" data-bind="css:{active:PageIndex()==5}"><a href="#">第五页</a></li>
    </ul> 
</div>