Fixed sortField prop type.

pull/744/head
nestorrente 2020-12-08 12:16:38 +01:00
parent 266b593938
commit f76d1dfb34
6 changed files with 14 additions and 12 deletions

View File

@ -3,7 +3,7 @@ import Vue from 'vue';
declare class Column extends Vue { declare class Column extends Vue {
columnKey?: any; columnKey?: any;
field?: string; field?: string;
sortField?: string; sortField?: string | ((item: any) => any);
filterField?: string; filterField?: string;
sortable?: boolean; sortable?: boolean;
header?: any; header?: any;

View File

@ -11,7 +11,7 @@ export default {
default: null default: null
}, },
sortField: { sortField: {
type: String, type: [String, Function],
default: null default: null
}, },
filterField: { filterField: {

View File

@ -1,4 +1,4 @@
import Vue, { VNode } from 'vue'; import Vue, {VNode} from 'vue';
declare class DataTable extends Vue { declare class DataTable extends Vue {
value?: any[]; value?: any[];
@ -16,7 +16,7 @@ declare class DataTable extends Vue {
lazy?: boolean; lazy?: boolean;
loading?: boolean; loading?: boolean;
loadingIcon?: string; loadingIcon?: string;
sortField?: string | Function; sortField?: string | ((item: any) => any);
sortOrder?: number; sortOrder?: number;
defaultSortOrder?: number; defaultSortOrder?: number;
multiSortMeta?: any[]; multiSortMeta?: any[];
@ -26,7 +26,7 @@ declare class DataTable extends Vue {
[s: string]: any; [s: string]: any;
}; };
filterLocale?: string; filterLocale?: string;
selection?: any[]|any; selection?: any[] | any;
selectionMode?: string; selectionMode?: string;
compareSelectionBy?: string; compareSelectionBy?: string;
metaKeySelection?: boolean; metaKeySelection?: boolean;
@ -43,7 +43,7 @@ declare class DataTable extends Vue {
expandedRowIcon?: string; expandedRowIcon?: string;
collapsedRowIcon?: string; collapsedRowIcon?: string;
rowGroupMode?: string; rowGroupMode?: string;
groupRowsBy?: string[]|string; groupRowsBy?: string[] | string;
expandableRowGroups?: boolean; expandableRowGroups?: boolean;
expandedRowGroups?: any[]; expandedRowGroups?: any[];
stateStorage?: string; stateStorage?: string;
@ -58,6 +58,7 @@ declare class DataTable extends Vue {
virtualScroll?: boolean; virtualScroll?: boolean;
virtualRowHeight?: string; virtualRowHeight?: string;
virtualScrollDelay?: number; virtualScrollDelay?: number;
$emit(eventName: 'page', event: Event): this; $emit(eventName: 'page', event: Event): this;
$emit(eventName: 'sort', event: Event): this; $emit(eventName: 'sort', event: Event): this;
$emit(eventName: 'filter', 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-init', event: Event): this;
$emit(eventName: 'row-edit-save', event: Event): this; $emit(eventName: 'row-edit-save', event: Event): this;
$emit(eventName: 'row-edit-cancel', event: Event): this; $emit(eventName: 'row-edit-cancel', event: Event): this;
$slots: { $slots: {
header: VNode[]; header: VNode[];
paginatorLeft: VNode[]; paginatorLeft: VNode[];
paginatorRight: VNode[]; paginatorRight: VNode[];
empty: VNode[]; empty: VNode[];
footer: VNode[]; footer: VNode[];
} };
} }
export default DataTable; export default DataTable;

View File

@ -85,7 +85,7 @@ export default {
default: 'single' default: 'single'
}, },
sortField: { sortField: {
type: String, type: [String, Function],
default: null default: null
}, },
sortOrder: { sortOrder: {

View File

@ -13,7 +13,7 @@ declare class DataView extends Vue {
pageLinkSize?: number; pageLinkSize?: number;
rowsPerPageOptions?: number[]; rowsPerPageOptions?: number[];
currentPageReportTemplate?: string; currentPageReportTemplate?: string;
sortField?: string; sortField?: string | ((item: any) => any);
sortOrder?: number; sortOrder?: number;
lazy?: boolean; lazy?: boolean;
$emit(eventName: 'page', event: Event): this; $emit(eventName: 'page', event: Event): this;

View File

@ -95,7 +95,7 @@ export default {
default: '({currentPage} of {totalPages})' default: '({currentPage} of {totalPages})'
}, },
sortField: { sortField: {
type: String, type: [String, Function],
default: null default: null
}, },
sortOrder: { sortOrder: {