Merge branch 'layui:main' into main

pull/1055/head
sunxiaobin89 2022-06-27 15:56:39 +08:00 committed by GitHub
commit 84b85b16a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 11 deletions

View File

@ -101,7 +101,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
//字符常量 //字符常量
,MOD_NAME = 'table', ELEM = '.layui-table', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', HIDE_V = 'layui-hide-v', DISABLED = 'layui-disabled', NONE = 'layui-none' ,MOD_NAME = 'table', ELEM = '.layui-table', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', HIDE_V = 'layui-hide-v', DISABLED = 'layui-disabled', NONE = 'layui-none'
,ELEM_VIEW = 'layui-table-view', ELEM_TOOL = '.layui-table-tool', ELEM_BOX = '.layui-table-box', ELEM_INIT = '.layui-table-init', ELEM_HEADER = '.layui-table-header', ELEM_BODY = '.layui-table-body', ELEM_MAIN = '.layui-table-main', ELEM_FIXED = '.layui-table-fixed', ELEM_FIXL = '.layui-table-fixed-l', ELEM_FIXR = '.layui-table-fixed-r', ELEM_TOTAL = '.layui-table-total', ELEM_PAGE = '.layui-table-page', ELEM_SORT = '.layui-table-sort', ELEM_EDIT = 'layui-table-edit', ELEM_HOVER = 'layui-table-hover' ,ELEM_VIEW = 'layui-table-view', ELEM_TOOL = '.layui-table-tool', ELEM_BOX = '.layui-table-box', ELEM_INIT = '.layui-table-init', ELEM_HEADER = '.layui-table-header', ELEM_BODY = '.layui-table-body', ELEM_MAIN = '.layui-table-main', ELEM_FIXED = '.layui-table-fixed', ELEM_FIXL = '.layui-table-fixed-l', ELEM_FIXR = '.layui-table-fixed-r', ELEM_TOTAL = '.layui-table-total', ELEM_PAGE = '.layui-table-page', ELEM_PAGE_VIEW = '.layui-table-pageview', ELEM_SORT = '.layui-table-sort', ELEM_EDIT = 'layui-table-edit', ELEM_HOVER = 'layui-table-hover'
//thead区域模板 //thead区域模板
,TPL_HEADER = function(options){ ,TPL_HEADER = function(options){
@ -759,8 +759,8 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
that.layMain.append(that.layNone = layNone); that.layMain.append(that.layNone = layNone);
// 异常情况下对 page 和 total 的内容处理 // 异常情况下对 page 和 total 的内容处理
that.layPage && that.layPage.addClass(HIDE_V).find('>div').html(''); that.layTotal.addClass(HIDE_V);
that.layTotal && that.layTotal.addClass(HIDE_V).find('tbody').html(''); that.layPage.find(ELEM_PAGE_VIEW).addClass(HIDE_V);
table.cache[that.key] = []; //格式化缓存数据 table.cache[that.key] = []; //格式化缓存数据
}; };
@ -1029,13 +1029,11 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
that.layTotal[data.length == 0 ? 'addClass' : 'removeClass'](HIDE_V); that.layTotal[data.length == 0 ? 'addClass' : 'removeClass'](HIDE_V);
//显示隐藏分页栏 //显示隐藏分页栏
if(!options.pagebar){ that.layPage.find(ELEM_PAGE_VIEW)[
that.layPage[
(count == 0 || (data.length === 0 && curr == 1)) (count == 0 || (data.length === 0 && curr == 1))
? 'addClass' ? 'addClass'
: 'removeClass' : 'removeClass'
](HIDE_V); ](HIDE_V);
}
//如果无数据 //如果无数据
if(data.length === 0){ if(data.length === 0){