Files
orion-visor/orion-visor-ui/src/hooks/card.ts

36 lines
868 B
TypeScript
Raw Normal View History

2024-07-29 10:25:11 +08:00
import type { PaginationProps } from '@arco-design/web-vue';
import type { ColResponsiveValue } from '@/types/card';
import { reactive } from 'vue';
import { isNumber } from '@/utils/is';
import { useAppStore } from '@/store';
import { CardPageSizeOptions } from '@/types/const';
/**
*
*/
export const useCardColLayout = (): ColResponsiveValue => {
return reactive({
xs: 24,
sm: 12,
md: 8,
lg: 8,
xl: 8,
xxl: 6,
});
};
/**
*
*/
export const useCardPagination = (): PaginationProps => {
const appStore = useAppStore();
return reactive({
total: 0,
current: 1,
pageSize: isNumber(appStore.defaultCardPageSize) ? appStore.defaultCardPageSize : CardPageSizeOptions[0],
showTotal: true,
showPageSize: true,
pageSizeOptions: CardPageSizeOptions
});
};