Skip to content

Commit

Permalink
chore(table): improve type def (#2762)
Browse files Browse the repository at this point in the history
  • Loading branch information
eiinu authored Dec 18, 2023
1 parent 987d30c commit 4fcfc5e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 117 deletions.
110 changes: 0 additions & 110 deletions src/packages/__VUE/table/common.ts

This file was deleted.

10 changes: 5 additions & 5 deletions src/packages/__VUE/table/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
</view>
</view>
</view>
<view v-if="summary" class="nut-table__summary">
<span class="nut-table__summary__text" v-html="summary().value"></span>
</view>
<view v-if="!curData.length" class="nut-table__nodata">
<div class="nut-table__nodata" :class="{ 'nut-table__nodata--border': bordered }">
<slot name="nodata"></slot>
<div v-if="!$slots.nodata" class="nut-table__nodata__text"> {{ translate('noData') }} </div>
</div>
</view>
<view v-if="summary" class="nut-table__summary">
<span class="nut-table__summary__text" v-html="summary().value"></span>
</view>
</view>
</template>
<script lang="ts">
Expand Down Expand Up @@ -123,8 +123,8 @@ export default create({
typeof item.sorter === 'function'
? state.curData.sort(item.sorter)
: item.sorter === 'default'
? state.curData.sort()
: state.curData;
? state.curData.sort()
: state.curData;
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/table/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ export interface TableColumns {
align?: string;
stylehead?: string;
stylecolumn?: string;
sorter?: Function;
render?: (rowData?: object, rowIndex?: number) => VNodeChild | string | VNode;
sorter?: Function | 'default';
render?: (rowData?: any, rowIndex?: number) => VNodeChild | string | VNode;
}

export interface TableProps {
Expand Down

0 comments on commit 4fcfc5e

Please sign in to comment.