define("pager", ["avalon"], function (avalon) { var _interface = function () { }; avalon.component("ms:pager", { $template: "页数: {{ currentPage }}/{{ totalPage }} " + " " + " ", currentPage: 1, totalPage: 1, _getPrevPage: _interface, _getNextPage: _interface, $init: function (vm, el) { vm._getPrevPage = function () { if (vm.currentPage > 1) { vm.currentPage--; vm.getPage(vm.currentPage); } }; vm._getNextPage = function () { if (vm.currentPage < vm.totalPage) { vm.currentPage++; vm.getPage(vm.currentPage); } }; }, $ready: function(vm, el){ el.msRetain = true; vm.getPage(1); } }) });