diff --git a/static/html/list.html b/static/html/list.html index 0d5fef4..821079d 100644 --- a/static/html/list.html +++ b/static/html/list.html @@ -37,8 +37,11 @@ // 当前页 this.current_page = 1 // 每页条数 - this.limit = 50 + this.limit = 10 + // 总条数 + this.count = 0 + // 参数 this.options = options this.opts = {"h": 'oo'} } @@ -75,6 +78,7 @@ }) // 分页组件 + me.count = resp.count me.auto_page_bar() }) }, @@ -86,9 +90,19 @@ const me = this //执行一个laypage实例 laypage.render({ - elem: me.opts.page_bar_elem //注意,这里的 test1 是 ID,不用加 # 号 - , count: 50 //数据总数,从服务端得到 - , limit: me.limit // 每页显示的条数。 + elem: me.opts.page_bar_elem //注意,这里的 test1 是 ID,不用加 # 号 + , curr: me.current_page + , count: me.count //数据总数,从服务端得到 + , limit: me.limit // 每页显示的条数。 + , layout: ['count', 'prev', 'page', 'next', 'limit'] + , jump: function (obj, first) { + //obj包含了当前分页的所有参数,比如: + me.current_page = obj.curr + me.limit = obj.limit + if (!first) { + me.fetch_data() + } + } }); }, // 合并属性 @@ -208,12 +222,14 @@ $.post('create', {'mind_name': mind_name, 'snapshot_data': view.json2string(snapshot_data)}, function (resp) { layer.closeAll() view.fetch_data() + console.log(resp) }) // post end } else { layer.msg('请输入导图名称') } } + // })