Skip to content

Commit b20865f

Browse files
committed
fix: ts type error
1 parent ddc3453 commit b20865f

File tree

5 files changed

+32
-44
lines changed

5 files changed

+32
-44
lines changed

components/mentions/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
88
import { flattenChildren, getOptionProps } from '../_util/props-util';
99
import { useInjectFormItemContext } from '../form/FormItemContext';
1010
import omit from '../_util/omit';
11+
import { optionProps } from '../vc-mentions/src/Option';
1112

1213
interface MentionsConfig {
1314
prefix?: string | string[];
@@ -209,6 +210,7 @@ const Mentions = defineComponent({
209210
export const MentionsOption = defineComponent({
210211
...Option,
211212
name: 'AMentionsOption',
213+
props: optionProps,
212214
});
213215

214216
export default Object.assign(Mentions, {

components/steps/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ const Steps = defineComponent({
122122
});
123123

124124
/* istanbul ignore next */
125-
export const Step = defineComponent({ ...VcStep, name: 'AStep', props: VcStepProps() });
125+
export const Step = defineComponent({
126+
...VcStep,
127+
name: 'AStep',
128+
props: VcStepProps(),
129+
});
126130
export default Object.assign(Steps, {
127131
Step,
128132
install: (app: App) => {

components/table/index.tsx

+20-39
Original file line numberDiff line numberDiff line change
@@ -14,48 +14,13 @@ export type { TableProps, TablePaginationConfig };
1414
const TableSummaryRow = defineComponent({ ...SummaryRow, name: 'ATableSummaryRow' });
1515
const TableSummaryCell = defineComponent({ ...SummaryCell, name: 'ATableSummaryCell' });
1616

17-
const TempSummary = defineComponent({
18-
...Summary,
17+
const TableSummary = Object.assign(Summary, {
18+
Cell: TableSummaryCell,
19+
Row: TableSummaryRow,
1920
name: 'ATableSummary',
2021
});
2122

22-
const TableSummary = TempSummary as typeof TempSummary & {
23-
Cell: typeof TableSummaryCell;
24-
Row: typeof TableSummaryRow;
25-
};
26-
TableSummary.Cell = TableSummaryCell;
27-
TableSummary.Row = TableSummaryRow;
28-
29-
const T = Table as typeof Table &
30-
Plugin & {
31-
Column: typeof Column;
32-
ColumnGroup: typeof ColumnGroup;
33-
Summary: typeof TableSummary;
34-
SELECTION_ALL: typeof SELECTION_ALL;
35-
SELECTION_INVERT: typeof SELECTION_INVERT;
36-
SELECTION_NONE: typeof SELECTION_NONE;
37-
};
38-
39-
T.SELECTION_ALL = SELECTION_ALL;
40-
T.SELECTION_INVERT = SELECTION_INVERT;
41-
T.SELECTION_NONE = SELECTION_NONE;
42-
43-
T.Column = Column;
44-
T.ColumnGroup = ColumnGroup;
45-
46-
T.Summary = TableSummary;
47-
4823
/* istanbul ignore next */
49-
T.install = function (app: App) {
50-
app.component(TableSummary.name, TableSummary);
51-
app.component(TableSummaryCell.name, TableSummaryCell);
52-
app.component(TableSummaryRow.name, TableSummaryRow);
53-
app.component(T.name, T);
54-
app.component(T.Column.name, Column);
55-
app.component(T.ColumnGroup.name, ColumnGroup);
56-
return app;
57-
};
58-
5924
export {
6025
tableProps,
6126
TableSummary,
@@ -65,4 +30,20 @@ export {
6530
ColumnGroup as TableColumnGroup,
6631
};
6732

68-
export default T;
33+
export default Object.assign(Table, {
34+
SELECTION_ALL,
35+
SELECTION_INVERT,
36+
SELECTION_NONE,
37+
Column,
38+
ColumnGroup,
39+
Summary: TableSummary,
40+
install: (app: App) => {
41+
app.component(TableSummary.name, TableSummary);
42+
app.component(TableSummaryCell.name, TableSummaryCell);
43+
app.component(TableSummaryRow.name, TableSummaryRow);
44+
app.component(Table.name, Table);
45+
app.component(Column.name, Column);
46+
app.component(ColumnGroup.name, ColumnGroup);
47+
return app;
48+
},
49+
});

components/tree/index.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import type { App } from 'vue';
22
import { defineComponent } from 'vue';
33
import Tree from './Tree';
4-
import { TreeNode as VsTreeNode } from '../vc-tree';
4+
import { TreeNode as VcTreeNode } from '../vc-tree';
55
import DirectoryTree from './DirectoryTree';
6+
import { treeNodeProps } from '../vc-tree/props';
67

78
export type { EventDataNode, DataNode } from '../vc-tree/interface';
89

@@ -25,7 +26,7 @@ export type {
2526

2627
/* istanbul ignore next */
2728

28-
const TreeNode = defineComponent({ ...VsTreeNode, name: 'ATreeNode' });
29+
const TreeNode = defineComponent({ ...VcTreeNode, name: 'ATreeNode', props: treeNodeProps });
2930

3031
export { DirectoryTree, TreeNode };
3132

components/vc-table/Footer/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ export interface FooterProps<RecordType = DefaultRecordType> {
1212
flattenColumns: FlattenColumns<RecordType>;
1313
}
1414

15-
export default defineComponent({
15+
export default defineComponent<FooterProps>({
1616
name: 'Footer',
1717
inheritAttrs: false,
18-
props: ['stickyOffsets', 'flattenColumns'],
18+
props: ['stickyOffsets', 'flattenColumns'] as any,
1919
setup(props, { slots }) {
2020
const tableContext = useInjectTable();
2121
useProvideSummary(

0 commit comments

Comments
 (0)