22 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
<wxs module="getTableWidth">
 | 
						|
  module.exports = function (tableWidth) {
 | 
						|
    if (!tableWidth) {
 | 
						|
      return;
 | 
						|
    }
 | 
						|
    return tableWidth + 'rpx'
 | 
						|
  }
 | 
						|
</wxs>
 | 
						|
<scroll-view hidden="{{!showList.length||!showHeader.length}}" scroll-x class="table1-view" style="--max_line:{{maxLine}};--width:{{getTableWidth(tableWidth)}}">
 | 
						|
  <view class="table1 d-table table-class">
 | 
						|
    <view class="d-table-row tr-class">
 | 
						|
      <view class="d-table-cell th-class" wx:for="{{showHeader}}" wx:key="index">{{item.title}}</view>
 | 
						|
    </view>
 | 
						|
    <view bindtap="onTap" data-index="{{index}}" bindlongpress="onLongPress" class="tr-class d-table-row {{currentIndex===index?'active':''}} {{index%2===0?'tr-class_even':'tr-class_odd'}}" wx:for="{{showList}}" wx:key="index">
 | 
						|
      <view class="d-table-cell td-class " wx:for="{{showHeader}}" wx:for-item="head" wx:for-index="hindex" wx:key="hindex" style="background-color: {{item[head.key].bg}};color:{{item[head.key].color}}">
 | 
						|
        <view class="text">
 | 
						|
          {{item[head.key].text}}
 | 
						|
        </view>
 | 
						|
      </view>
 | 
						|
    </view>
 | 
						|
  </view>
 | 
						|
</scroll-view> |