diff --git a/src/components/column/Column.d.ts b/src/components/column/Column.d.ts index 70eb201c1..02d85a1d6 100755 --- a/src/components/column/Column.d.ts +++ b/src/components/column/Column.d.ts @@ -3,7 +3,7 @@ import Vue from 'vue'; declare class Column extends Vue { columnKey?: any; field?: string; - sortField?: string; + sortField?: string | ((item: any) => any); filterField?: string; sortable?: boolean; header?: any; @@ -30,4 +30,4 @@ declare class Column extends Vue { frozen?: boolean; } -export default Column; \ No newline at end of file +export default Column; diff --git a/src/components/column/Column.vue b/src/components/column/Column.vue index d92907587..499473a14 100755 --- a/src/components/column/Column.vue +++ b/src/components/column/Column.vue @@ -11,7 +11,7 @@ export default { default: null }, sortField: { - type: String, + type: [String, Function], default: null }, filterField: { diff --git a/src/components/datatable/DataTable.d.ts b/src/components/datatable/DataTable.d.ts index 5cf8ef34b..fee5c6b58 100755 --- a/src/components/datatable/DataTable.d.ts +++ b/src/components/datatable/DataTable.d.ts @@ -1,4 +1,4 @@ -import Vue, { VNode } from 'vue'; +import Vue, {VNode} from 'vue'; declare class DataTable extends Vue { value?: any[]; @@ -16,7 +16,7 @@ declare class DataTable extends Vue { lazy?: boolean; loading?: boolean; loadingIcon?: string; - sortField?: string | Function; + sortField?: string | ((item: any) => any); sortOrder?: number; defaultSortOrder?: number; multiSortMeta?: any[]; @@ -26,7 +26,7 @@ declare class DataTable extends Vue { [s: string]: any; }; filterLocale?: string; - selection?: any[]|any; + selection?: any[] | any; selectionMode?: string; compareSelectionBy?: string; metaKeySelection?: boolean; @@ -43,7 +43,7 @@ declare class DataTable extends Vue { expandedRowIcon?: string; collapsedRowIcon?: string; rowGroupMode?: string; - groupRowsBy?: string[]|string; + groupRowsBy?: string[] | string; expandableRowGroups?: boolean; expandedRowGroups?: any[]; stateStorage?: string; @@ -58,6 +58,7 @@ declare class DataTable extends Vue { virtualScroll?: boolean; virtualRowHeight?: string; virtualScrollDelay?: number; + $emit(eventName: 'page', event: Event): this; $emit(eventName: 'sort', event: Event): this; $emit(eventName: 'filter', event: Event): this; @@ -78,13 +79,14 @@ declare class DataTable extends Vue { $emit(eventName: 'row-edit-init', event: Event): this; $emit(eventName: 'row-edit-save', event: Event): this; $emit(eventName: 'row-edit-cancel', event: Event): this; + $slots: { header: VNode[]; paginatorLeft: VNode[]; paginatorRight: VNode[]; empty: VNode[]; footer: VNode[]; - } + }; } -export default DataTable; \ No newline at end of file +export default DataTable; diff --git a/src/components/datatable/TableHeader.vue b/src/components/datatable/TableHeader.vue index fdc6bfcb3..bd8515c9e 100755 --- a/src/components/datatable/TableHeader.vue +++ b/src/components/datatable/TableHeader.vue @@ -85,7 +85,7 @@ export default { default: 'single' }, sortField: { - type: String, + type: [String, Function], default: null }, sortOrder: { diff --git a/src/components/dataview/DataView.d.ts b/src/components/dataview/DataView.d.ts index 36b675105..f04cd283f 100755 --- a/src/components/dataview/DataView.d.ts +++ b/src/components/dataview/DataView.d.ts @@ -13,7 +13,7 @@ declare class DataView extends Vue { pageLinkSize?: number; rowsPerPageOptions?: number[]; currentPageReportTemplate?: string; - sortField?: string; + sortField?: string | ((item: any) => any); sortOrder?: number; lazy?: boolean; $emit(eventName: 'page', event: Event): this; diff --git a/src/components/dataview/DataView.vue b/src/components/dataview/DataView.vue index 5ffb822f0..4f1e404aa 100755 --- a/src/components/dataview/DataView.vue +++ b/src/components/dataview/DataView.vue @@ -95,7 +95,7 @@ export default { default: '({currentPage} of {totalPages})' }, sortField: { - type: String, + type: [String, Function], default: null }, sortOrder: {