This commit is contained in:
aqu415
2022-02-12 22:48:31 +08:00
parent 7e07f7fab6
commit cd1dfa1652
+8 -6
View File
@@ -56,13 +56,14 @@
const me = this const me = this
//执行一个laypage实例 //执行一个laypage实例
laypage.render({ laypage.render({
elem: 'page_bar' //注意,这里的 test1 是 ID,不用加 # 号 elem: me.opts.page_bar_elem //注意,这里的 test1 是 ID,不用加 # 号
, count: 50 //数据总数,从服务端得到 , count: 50 //数据总数,从服务端得到
, limit: me.limit // 每页显示的条数。 , limit: me.limit // 每页显示的条数。
}); });
}, },
// 合并属性
merge_obj: function (target, src) { merge_obj: function (target, src) {
for (var o in src) { for (let o in src) {
if (o in target) { if (o in target) {
if (typeof target[o] === 'object' && Object.prototype.toString.call(target[o]).toLowerCase() === '[object object]' && !target[o].length) { if (typeof target[o] === 'object' && Object.prototype.toString.call(target[o]).toLowerCase() === '[object object]' && !target[o].length) {
this.merge(target[o], src[o]); this.merge(target[o], src[o]);
@@ -79,15 +80,16 @@
$(function () { $(function () {
// 初始化对象 // 初始化对象
const list_view = new listView({'s': 'p'}) const view = new listView({'page_bar_elem': 'page_bar'})
list_view.init() view.init()
list_view.fetch_data() view.fetch_data()
view.auto_page_bar()
// 绑定事件 // 绑定事件
$('#c_').click(function () { $('#c_').click(function () {
const mind_name = $('#mind_name').val() const mind_name = $('#mind_name').val()
if (mind_name) { if (mind_name) {
list_view.fetch_data() view.fetch_data()
} else { } else {
layer.msg('请输入导图名称') layer.msg('请输入导图名称')
} }