Files

1 line
2.0 KiB
Plaintext

<wxs src="../common/utils.wxs" module="_"/><view class="{{tableClasses}} {{layoutClass}} class {{prefix}}-class" style="{{_._style([style, customStyle])}}"><scroll-view class="{{contentClasses || classPrefix + '__content'}}" style="{{tableContentStyles}}" scroll-x scroll-y="{{!!(height || maxHeight)}}" bindscroll="onScroll"><view class="{{classPrefix}}__table-elm" style="{{tableElementStyles}}"><view wx:if="{{showHeader}}" class="{{theadClasses}}"><view class="{{classPrefix}}__header-tr"><view wx:for="{{columns}}" wx:for-item="col" wx:for-index="colIndex" wx:key="colKey" class="{{classPrefix}}__th {{thClassNames[colIndex]}}" style="{{colStyles[colIndex]}}"><view class="{{classPrefix}}__th-content">{{col.title}}</view></view></view></view><view class="{{tbodyClasses}}"><view wx:if="{{isEmpty}}" class="{{classPrefix}}__empty-row"><view class="{{classPrefix}}__empty" style="grid-column: span {{columnsLength}}"><block wx:if="{{empty}}">{{empty}}</block><slot wx:else name="empty"/></view></view><view wx:for="{{renderData}}" wx:for-item="rowItem" wx:for-index="trIndex" wx:key="rowId" class="{{classPrefix}}__tr {{rowItem.rowClass}}" style="{{rowItem.rowStyle}}" data-row-index="{{rowItem.rowIndex}}" bind:tap="onRowClick"><block wx:for="{{rowItem.cells}}" wx:for-item="cell" wx:for-index="tdIndex" wx:key="colKey"><view wx:if="{{!cell.skipped}}" class="{{classPrefix}}__td {{cell.className}} {{cell.isLastRow ? classPrefix + '__td-last-row' : ''}} {{cell.isFirstCol ? classPrefix + '__td-first-col' : ''}}" style="{{colStyles[tdIndex]}}" data-row-index="{{rowItem.rowIndex}}" data-col-index="{{tdIndex}}" bind:tap="onCellClick"><view class="{{classPrefix}}__td-content">{{cell.content}}</view></view></block></view></view></view><view wx:if="{{loading}}" class="{{classPrefix}}__loading--full"><slot name="loading"><t-loading/></slot></view></scroll-view><view wx:if="{{footerSummary}}" class="{{classPrefix}}__bottom-content">{{footerSummary}}</view><slot name="footer-summary"/></view>