mirror of https://github.com/layui/layui
优化 table 的 `style` 表头属性,以便向下兼容
parent
d1f859a761
commit
827ef6f346
|
@ -163,7 +163,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
return '';
|
return '';
|
||||||
}()
|
}()
|
||||||
,'{{# var isSort = !(item2.colGroup) && item2.sort; }}'
|
,'{{# var isSort = !(item2.colGroup) && item2.sort; }}'
|
||||||
,'<th data-field="{{= item2.field||i2 }}" data-key="{{=d.index}}-{{=i1}}-{{=i2}}" {{# if( item2.parentKey){ }}data-parentkey="{{= item2.parentKey }}"{{# } }} {{# if(item2.minWidth){ }}data-minwidth="{{=item2.minWidth}}"{{# } }} {{# if(item2.maxWidth){ }}data-maxwidth="{{=item2.maxWidth}}"{{# } }} '+ rowCols +' {{# if(item2.unresize || item2.colGroup){ }}data-unresize="true"{{# } }} class="{{# if(item2.hide){ }}layui-hide{{# } }}{{# if(isSort){ }} layui-unselect{{# } }}{{# if(!item2.field){ }} layui-table-col-special{{# } }}"{{# if(item2.title){ }} title="{{ layui.$(\'<div>\' + item2.title + \'</div>\').text() }}"{{# } }}>'
|
,'<th data-field="{{= item2.field||i2 }}" data-key="{{=d.index}}-{{=i1}}-{{=i2}}" {{# if( item2.parentKey){ }}data-parentkey="{{= item2.parentKey }}"{{# } }} {{# if(item2.minWidth){ }}data-minwidth="{{=item2.minWidth}}"{{# } }} {{# if(item2.maxWidth){ }}data-maxwidth="{{=item2.maxWidth}}"{{# } }} {{# if(item2.style){ }}style="{{=item2.style}}"{{# } }} '+ rowCols +' {{# if(item2.unresize || item2.colGroup){ }}data-unresize="true"{{# } }} class="{{# if(item2.hide){ }}layui-hide{{# } }}{{# if(isSort){ }} layui-unselect{{# } }}{{# if(!item2.field){ }} layui-table-col-special{{# } }}"{{# if(item2.title){ }} title="{{ layui.$(\'<div>\' + item2.title + \'</div>\').text() }}"{{# } }}>'
|
||||||
,'<div class="layui-table-cell laytable-cell-'
|
,'<div class="layui-table-cell laytable-cell-'
|
||||||
,'{{# if(item2.colGroup){ }}'
|
,'{{# if(item2.colGroup){ }}'
|
||||||
,'group'
|
,'group'
|
||||||
|
@ -1155,6 +1155,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
if(item3.event) attr.push('lay-event="'+ item3.event +'"'); //自定义事件
|
if(item3.event) attr.push('lay-event="'+ item3.event +'"'); //自定义事件
|
||||||
if(item3.minWidth) attr.push('data-minwidth="'+ item3.minWidth +'"'); // 单元格最小宽度
|
if(item3.minWidth) attr.push('data-minwidth="'+ item3.minWidth +'"'); // 单元格最小宽度
|
||||||
if(item3.maxWidth) attr.push('data-maxwidth="'+ item3.maxWidth +'"'); // 单元格最大宽度
|
if(item3.maxWidth) attr.push('data-maxwidth="'+ item3.maxWidth +'"'); // 单元格最大宽度
|
||||||
|
if(item3.style) attr.push('style="'+ item3.style +'"'); // 自定义单元格样式
|
||||||
return attr.join(' ');
|
return attr.join(' ');
|
||||||
}() +' class="'+ function(){ // 追加样式
|
}() +' class="'+ function(){ // 追加样式
|
||||||
var classNames = [];
|
var classNames = [];
|
||||||
|
@ -1167,11 +1168,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
: (key + ' laytable-cell-' + item3.type);
|
: (key + ' laytable-cell-' + item3.type);
|
||||||
}() +'"'
|
}() +'"'
|
||||||
+ (item3.align ? ' align="'+ item3.align +'"' : '')
|
+ (item3.align ? ' align="'+ item3.align +'"' : '')
|
||||||
+ function(){
|
+'>'
|
||||||
var attr = [];
|
|
||||||
if(item3.style) attr.push('style="'+ item3.style +'"'); //自定义单元格样式
|
|
||||||
return attr.join(' ');
|
|
||||||
}() +'>'
|
|
||||||
+ function(){
|
+ function(){
|
||||||
var tplData = $.extend(true, {
|
var tplData = $.extend(true, {
|
||||||
LAY_COL: item3
|
LAY_COL: item3
|
||||||
|
@ -1454,6 +1451,7 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
var attr = [];
|
var attr = [];
|
||||||
if(item3.minWidth) attr.push('data-minwidth="'+ item3.minWidth +'"'); // 单元格最小宽度
|
if(item3.minWidth) attr.push('data-minwidth="'+ item3.minWidth +'"'); // 单元格最小宽度
|
||||||
if(item3.maxWidth) attr.push('data-maxwidth="'+ item3.maxWidth +'"'); // 单元格最小宽度
|
if(item3.maxWidth) attr.push('data-maxwidth="'+ item3.maxWidth +'"'); // 单元格最小宽度
|
||||||
|
if(item3.style) attr.push('style="'+ item3.style +'"'); // 自定义单元格样式
|
||||||
return attr.join(' ');
|
return attr.join(' ');
|
||||||
}() +' class="'+ function(){ // 追加样式
|
}() +' class="'+ function(){ // 追加样式
|
||||||
var classNames = [];
|
var classNames = [];
|
||||||
|
@ -1468,7 +1466,6 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){
|
||||||
}() +'"'+ function(){
|
}() +'"'+ function(){
|
||||||
var attr = [];
|
var attr = [];
|
||||||
if(item3.align) attr.push('align="'+ item3.align +'"'); // 对齐方式
|
if(item3.align) attr.push('align="'+ item3.align +'"'); // 对齐方式
|
||||||
if(item3.style) attr.push('style="'+ item3.style +'"'); // 自定义单元格样式
|
|
||||||
return attr.join(' ');
|
return attr.join(' ');
|
||||||
}() +'>' + function(){
|
}() +'>' + function(){
|
||||||
var totalRow = item3.totalRow || options.totalRow;
|
var totalRow = item3.totalRow || options.totalRow;
|
||||||
|
|
Loading…
Reference in New Issue