File tree Expand file tree Collapse file tree
adminforth/spa/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ const props = withDefaults(defineProps<{
393393 rows: any [] | null ,
394394 totalRows: number ,
395395 pageSize: number ,
396- pageSizeOptions? : { label: string ; value: any }[];
396+ pageSizeOptions? : { label: string ; value: any }[] | number [] | null ;
397397 checkboxes: any [],
398398 sort: any [],
399399 noRoundings? : boolean ,
@@ -436,9 +436,18 @@ const pageSizeInternal = ref(props.pageSize);
436436
437437const pageSizeOptionsComputed = computed (() => {
438438 if (! props .pageSizeOptions || props .pageSizeOptions .length === 0 ) {
439- return undefined ;
439+ return null ;
440440 }
441- return props .pageSizeOptions ;
441+
442+ const firstItem = props .pageSizeOptions [0 ];
443+ if (typeof firstItem === ' object' && firstItem !== null ) {
444+ return props .pageSizeOptions as { label: string ; value: any }[];
445+ }
446+
447+ return (props .pageSizeOptions as number []).map (size => ({
448+ label: size .toString (),
449+ value: size
450+ }));
442451});
443452
444453const sort: Ref <Array <{field: string , direction: string }>> = ref ([]);
You can’t perform that action at this time.
0 commit comments