Skip to content

Commit

Permalink
fix(Table): 修复 Column 的 CellProps 导出类型不对的问题 (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocean-gao committed Apr 26, 2024
1 parent 9b5142e commit 2f60437
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions components/date-picker/useCalendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,11 @@ export function useDay({
};
}

export interface QuarterItem {
name: string;
value: number;
}

export const useQuarter = (
props: CalendarProps,
selectedDates: Ref<DateObj[]>,
Expand All @@ -575,11 +580,6 @@ export const useQuarter = (
) => {
const isQuarterSelect = computed(() => props.type === PickerType.quarter);

interface QuarterItem {
name: string;
value: number;
}

const format = 'yyyy-MM';

const quarterList = [
Expand Down
8 changes: 4 additions & 4 deletions components/table/column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
provideKey,
} from './const';

import type { CellProps } from './components/cell';
import type { InnerCellProps } from './components/cell';
import type { ActionType, RowType } from './interface';

export type SortOrderType = 'descend' | 'ascend' | false;
Expand Down Expand Up @@ -82,7 +82,7 @@ export const columnProps = {
fixed: {
type: [Boolean, String] as PropType<'left' | 'right' | true | false>,
},
formatter: Function as PropType<(data: CellProps) => any>,
formatter: Function as PropType<(data: InnerCellProps) => any>,
resizable: {
type: Boolean,
default: false,
Expand Down Expand Up @@ -121,8 +121,8 @@ export type ColumnProps = ExtractPublicPropTypes<typeof columnProps>;

export type ColumnChildren = Array<
ColumnProps & {
render?: (data: CellProps) => VNode[];
renderHeader?: (data: CellProps) => VNode[];
render?: (data: InnerCellProps) => VNode[];
renderHeader?: (data: InnerCellProps) => VNode[];
children?: ColumnChildren;
}
>;
Expand Down
2 changes: 1 addition & 1 deletion components/table/components/cell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const cellProps = {
] as PropType<any>,
} as const satisfies ComponentObjectPropsOptions;

export type CellProps = Partial<ExtractPropTypes<typeof cellProps>>;
export type InnerCellProps = ExtractPropTypes<typeof cellProps>;

export default defineComponent({
name: 'FTableCell',
Expand Down

0 comments on commit 2f60437

Please sign in to comment.