mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-01-23 09:40:22 +08:00
chore: table size放到settings (#1294)
This commit is contained in:
parent
787bc462e7
commit
8447331197
@ -222,7 +222,6 @@
|
|||||||
const getBindValues = computed(() => {
|
const getBindValues = computed(() => {
|
||||||
const dataSource = unref(getDataSourceRef);
|
const dataSource = unref(getDataSourceRef);
|
||||||
let propsData: Recordable = {
|
let propsData: Recordable = {
|
||||||
size: 'middle',
|
|
||||||
// ...(dataSource.length === 0 ? { getPopupContainer: () => document.body } : {}),
|
// ...(dataSource.length === 0 ? { getPopupContainer: () => document.body } : {}),
|
||||||
...attrs,
|
...attrs,
|
||||||
customRow,
|
customRow,
|
||||||
|
@ -2,7 +2,14 @@ import componentSetting from '/@/settings/componentSetting';
|
|||||||
|
|
||||||
const { table } = componentSetting;
|
const { table } = componentSetting;
|
||||||
|
|
||||||
const { pageSizeOptions, defaultPageSize, fetchSetting, defaultSortFn, defaultFilterFn } = table;
|
const {
|
||||||
|
pageSizeOptions,
|
||||||
|
defaultPageSize,
|
||||||
|
fetchSetting,
|
||||||
|
defaultSize,
|
||||||
|
defaultSortFn,
|
||||||
|
defaultFilterFn,
|
||||||
|
} = table;
|
||||||
|
|
||||||
export const ROW_KEY = 'key';
|
export const ROW_KEY = 'key';
|
||||||
|
|
||||||
@ -15,6 +22,9 @@ export const PAGE_SIZE = defaultPageSize;
|
|||||||
// Common interface field settings
|
// Common interface field settings
|
||||||
export const FETCH_SETTING = fetchSetting;
|
export const FETCH_SETTING = fetchSetting;
|
||||||
|
|
||||||
|
// Default Size
|
||||||
|
export const DEFAULT_SIZE = defaultSize;
|
||||||
|
|
||||||
// Configure general sort function
|
// Configure general sort function
|
||||||
export const DEFAULT_SORT_FN = defaultSortFn;
|
export const DEFAULT_SORT_FN = defaultSortFn;
|
||||||
|
|
||||||
|
@ -7,9 +7,10 @@ import type {
|
|||||||
SorterResult,
|
SorterResult,
|
||||||
TableCustomRecord,
|
TableCustomRecord,
|
||||||
TableRowSelection,
|
TableRowSelection,
|
||||||
|
SizeType,
|
||||||
} from './types/table';
|
} from './types/table';
|
||||||
import type { FormProps } from '/@/components/Form';
|
import type { FormProps } from '/@/components/Form';
|
||||||
import { DEFAULT_FILTER_FN, DEFAULT_SORT_FN, FETCH_SETTING } from './const';
|
import { DEFAULT_FILTER_FN, DEFAULT_SORT_FN, FETCH_SETTING, DEFAULT_SIZE } from './const';
|
||||||
import { propTypes } from '/@/utils/propTypes';
|
import { propTypes } from '/@/utils/propTypes';
|
||||||
|
|
||||||
export const basicProps = {
|
export const basicProps = {
|
||||||
@ -141,4 +142,8 @@ export const basicProps = {
|
|||||||
}) => Promise<any>
|
}) => Promise<any>
|
||||||
>,
|
>,
|
||||||
},
|
},
|
||||||
|
size: {
|
||||||
|
type: String as PropType<SizeType>,
|
||||||
|
default: DEFAULT_SIZE,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
@ -21,6 +21,8 @@ export default {
|
|||||||
pageSizeOptions: ['10', '50', '80', '100'],
|
pageSizeOptions: ['10', '50', '80', '100'],
|
||||||
// Default display quantity on one page
|
// Default display quantity on one page
|
||||||
defaultPageSize: 10,
|
defaultPageSize: 10,
|
||||||
|
// Default Size
|
||||||
|
defaultSize: 'middle',
|
||||||
// Custom general sort function
|
// Custom general sort function
|
||||||
defaultSortFn: (sortInfo: SorterResult) => {
|
defaultSortFn: (sortInfo: SorterResult) => {
|
||||||
const { field, order } = sortInfo;
|
const { field, order } = sortInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user