fix: ts type error
parent
ddc34539a9
commit
b20865ffb6
|
@ -8,6 +8,7 @@ import useConfigInject from '../_util/hooks/useConfigInject';
|
||||||
import { flattenChildren, getOptionProps } from '../_util/props-util';
|
import { flattenChildren, getOptionProps } from '../_util/props-util';
|
||||||
import { useInjectFormItemContext } from '../form/FormItemContext';
|
import { useInjectFormItemContext } from '../form/FormItemContext';
|
||||||
import omit from '../_util/omit';
|
import omit from '../_util/omit';
|
||||||
|
import { optionProps } from '../vc-mentions/src/Option';
|
||||||
|
|
||||||
interface MentionsConfig {
|
interface MentionsConfig {
|
||||||
prefix?: string | string[];
|
prefix?: string | string[];
|
||||||
|
@ -209,6 +210,7 @@ const Mentions = defineComponent({
|
||||||
export const MentionsOption = defineComponent({
|
export const MentionsOption = defineComponent({
|
||||||
...Option,
|
...Option,
|
||||||
name: 'AMentionsOption',
|
name: 'AMentionsOption',
|
||||||
|
props: optionProps,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default Object.assign(Mentions, {
|
export default Object.assign(Mentions, {
|
||||||
|
|
|
@ -122,7 +122,11 @@ const Steps = defineComponent({
|
||||||
});
|
});
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
export const Step = defineComponent({ ...VcStep, name: 'AStep', props: VcStepProps() });
|
export const Step = defineComponent({
|
||||||
|
...VcStep,
|
||||||
|
name: 'AStep',
|
||||||
|
props: VcStepProps(),
|
||||||
|
});
|
||||||
export default Object.assign(Steps, {
|
export default Object.assign(Steps, {
|
||||||
Step,
|
Step,
|
||||||
install: (app: App) => {
|
install: (app: App) => {
|
||||||
|
|
|
@ -14,48 +14,13 @@ export type { TableProps, TablePaginationConfig };
|
||||||
const TableSummaryRow = defineComponent({ ...SummaryRow, name: 'ATableSummaryRow' });
|
const TableSummaryRow = defineComponent({ ...SummaryRow, name: 'ATableSummaryRow' });
|
||||||
const TableSummaryCell = defineComponent({ ...SummaryCell, name: 'ATableSummaryCell' });
|
const TableSummaryCell = defineComponent({ ...SummaryCell, name: 'ATableSummaryCell' });
|
||||||
|
|
||||||
const TempSummary = defineComponent({
|
const TableSummary = Object.assign(Summary, {
|
||||||
...Summary,
|
Cell: TableSummaryCell,
|
||||||
|
Row: TableSummaryRow,
|
||||||
name: 'ATableSummary',
|
name: 'ATableSummary',
|
||||||
});
|
});
|
||||||
|
|
||||||
const TableSummary = TempSummary as typeof TempSummary & {
|
|
||||||
Cell: typeof TableSummaryCell;
|
|
||||||
Row: typeof TableSummaryRow;
|
|
||||||
};
|
|
||||||
TableSummary.Cell = TableSummaryCell;
|
|
||||||
TableSummary.Row = TableSummaryRow;
|
|
||||||
|
|
||||||
const T = Table as typeof Table &
|
|
||||||
Plugin & {
|
|
||||||
Column: typeof Column;
|
|
||||||
ColumnGroup: typeof ColumnGroup;
|
|
||||||
Summary: typeof TableSummary;
|
|
||||||
SELECTION_ALL: typeof SELECTION_ALL;
|
|
||||||
SELECTION_INVERT: typeof SELECTION_INVERT;
|
|
||||||
SELECTION_NONE: typeof SELECTION_NONE;
|
|
||||||
};
|
|
||||||
|
|
||||||
T.SELECTION_ALL = SELECTION_ALL;
|
|
||||||
T.SELECTION_INVERT = SELECTION_INVERT;
|
|
||||||
T.SELECTION_NONE = SELECTION_NONE;
|
|
||||||
|
|
||||||
T.Column = Column;
|
|
||||||
T.ColumnGroup = ColumnGroup;
|
|
||||||
|
|
||||||
T.Summary = TableSummary;
|
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
T.install = function (app: App) {
|
|
||||||
app.component(TableSummary.name, TableSummary);
|
|
||||||
app.component(TableSummaryCell.name, TableSummaryCell);
|
|
||||||
app.component(TableSummaryRow.name, TableSummaryRow);
|
|
||||||
app.component(T.name, T);
|
|
||||||
app.component(T.Column.name, Column);
|
|
||||||
app.component(T.ColumnGroup.name, ColumnGroup);
|
|
||||||
return app;
|
|
||||||
};
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
tableProps,
|
tableProps,
|
||||||
TableSummary,
|
TableSummary,
|
||||||
|
@ -65,4 +30,20 @@ export {
|
||||||
ColumnGroup as TableColumnGroup,
|
ColumnGroup as TableColumnGroup,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default T;
|
export default Object.assign(Table, {
|
||||||
|
SELECTION_ALL,
|
||||||
|
SELECTION_INVERT,
|
||||||
|
SELECTION_NONE,
|
||||||
|
Column,
|
||||||
|
ColumnGroup,
|
||||||
|
Summary: TableSummary,
|
||||||
|
install: (app: App) => {
|
||||||
|
app.component(TableSummary.name, TableSummary);
|
||||||
|
app.component(TableSummaryCell.name, TableSummaryCell);
|
||||||
|
app.component(TableSummaryRow.name, TableSummaryRow);
|
||||||
|
app.component(Table.name, Table);
|
||||||
|
app.component(Column.name, Column);
|
||||||
|
app.component(ColumnGroup.name, ColumnGroup);
|
||||||
|
return app;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import type { App } from 'vue';
|
import type { App } from 'vue';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import Tree from './Tree';
|
import Tree from './Tree';
|
||||||
import { TreeNode as VsTreeNode } from '../vc-tree';
|
import { TreeNode as VcTreeNode } from '../vc-tree';
|
||||||
import DirectoryTree from './DirectoryTree';
|
import DirectoryTree from './DirectoryTree';
|
||||||
|
import { treeNodeProps } from '../vc-tree/props';
|
||||||
|
|
||||||
export type { EventDataNode, DataNode } from '../vc-tree/interface';
|
export type { EventDataNode, DataNode } from '../vc-tree/interface';
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ export type {
|
||||||
|
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
|
|
||||||
const TreeNode = defineComponent({ ...VsTreeNode, name: 'ATreeNode' });
|
const TreeNode = defineComponent({ ...VcTreeNode, name: 'ATreeNode', props: treeNodeProps });
|
||||||
|
|
||||||
export { DirectoryTree, TreeNode };
|
export { DirectoryTree, TreeNode };
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,10 @@ export interface FooterProps<RecordType = DefaultRecordType> {
|
||||||
flattenColumns: FlattenColumns<RecordType>;
|
flattenColumns: FlattenColumns<RecordType>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent<FooterProps>({
|
||||||
name: 'Footer',
|
name: 'Footer',
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
props: ['stickyOffsets', 'flattenColumns'],
|
props: ['stickyOffsets', 'flattenColumns'] as any,
|
||||||
setup(props, { slots }) {
|
setup(props, { slots }) {
|
||||||
const tableContext = useInjectTable();
|
const tableContext = useInjectTable();
|
||||||
useProvideSummary(
|
useProvideSummary(
|
||||||
|
|
Loading…
Reference in New Issue