Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 将导出的组件加上前缀,无需手动按需导入时重命名 #8106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/anchor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { App, Plugin } from 'vue';
import type { AnchorProps } from './Anchor';
import type { AnchorLinkProps, AnchorLinkItemProps } from './AnchorLink';
import Anchor from './Anchor';
import AnchorLink from './AnchorLink';
import AAnchorLink from './AnchorLink';

Anchor.Link = AnchorLink;
Anchor.Link = AAnchorLink;

/* istanbul ignore next */
Anchor.install = function (app: App) {
Expand All @@ -14,9 +14,9 @@ Anchor.install = function (app: App) {
};

export type { AnchorLinkProps, AnchorProps, AnchorLinkItemProps };
export { AnchorLink, AnchorLink as Link };
export { AAnchorLink, AAnchorLink as Link };

export default Anchor as typeof Anchor &
Plugin & {
readonly Link: typeof AnchorLink;
readonly Link: typeof AAnchorLink;
};
4 changes: 2 additions & 2 deletions components/auto-complete/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export const autoCompleteProps = () => ({

export type AutoCompleteProps = Partial<ExtractPropTypes<ReturnType<typeof autoCompleteProps>>>;

export const AutoCompleteOption = Option;
export const AAutoCompleteOption = Option;

export const AutoCompleteOptGroup = OptGroup;
export const AAutoCompleteOptGroup = OptGroup;

const AutoComplete = defineComponent({
compatConfig: { MODE: 3 },
Expand Down
2 changes: 1 addition & 1 deletion components/avatar/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Avatar.install = function (app: App) {
app.component(Group.name, Group);
return app;
};
export { Group as AvatarGroup };
export { Group as AAvatarGroup };
export default Avatar as typeof Avatar &
Plugin & {
readonly Group: typeof Group;
Expand Down
2 changes: 1 addition & 1 deletion components/badge/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Badge.install = function (app: App) {
return app;
};

export { Ribbon as BadgeRibbon };
export { Ribbon as ABadgeRibbon };

export default Badge as typeof Badge &
Plugin & {
Expand Down
18 changes: 9 additions & 9 deletions components/breadcrumb/index.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import type { App, Plugin } from 'vue';
import Breadcrumb from './Breadcrumb';
import BreadcrumbItem from './BreadcrumbItem';
import BreadcrumbSeparator from './BreadcrumbSeparator';
import ABreadcrumbItem from './BreadcrumbItem';
import ABreadcrumbSeparator from './BreadcrumbSeparator';

export type { BreadcrumbProps } from './Breadcrumb';
export type { BreadcrumbItemProps } from './BreadcrumbItem';
export type { BreadcrumbSeparatorProps } from './BreadcrumbSeparator';

Breadcrumb.Item = BreadcrumbItem;
Breadcrumb.Separator = BreadcrumbSeparator;
Breadcrumb.Item = ABreadcrumbItem;
Breadcrumb.Separator = ABreadcrumbSeparator;

/* istanbul ignore next */
Breadcrumb.install = function (app: App) {
app.component(Breadcrumb.name, Breadcrumb);
app.component(BreadcrumbItem.name, BreadcrumbItem);
app.component(BreadcrumbSeparator.name, BreadcrumbSeparator);
app.component(ABreadcrumbItem.name, ABreadcrumbItem);
app.component(ABreadcrumbSeparator.name, ABreadcrumbSeparator);
return app;
};

export { BreadcrumbItem, BreadcrumbSeparator };
export { ABreadcrumbItem, ABreadcrumbSeparator };
export default Breadcrumb as typeof Breadcrumb &
Plugin & {
readonly Item: typeof BreadcrumbItem;
readonly Separator: typeof BreadcrumbSeparator;
readonly Item: typeof ABreadcrumbItem;
readonly Separator: typeof ABreadcrumbSeparator;
};
10 changes: 5 additions & 5 deletions components/button/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import type { App, Plugin } from 'vue';
import Button from './button';
import ButtonGroup from './button-group';
import AButtonGroup from './button-group';

import type { ButtonProps, ButtonShape, ButtonType } from './buttonTypes';
import type { ButtonGroupProps } from './button-group';
import type { SizeType as ButtonSize } from '../config-provider';

export type { ButtonProps, ButtonShape, ButtonType, ButtonGroupProps, ButtonSize };

Button.Group = ButtonGroup;
Button.Group = AButtonGroup;

/* istanbul ignore next */
Button.install = function (app: App) {
app.component(Button.name, Button);
app.component(ButtonGroup.name, ButtonGroup);
app.component(AButtonGroup.name, AButtonGroup);
return app;
};

export { ButtonGroup };
export { AButtonGroup };

export default Button as typeof Button &
Plugin & {
readonly Group: typeof ButtonGroup;
readonly Group: typeof AButtonGroup;
};
2 changes: 1 addition & 1 deletion components/card/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Card.install = function (app: App) {
return app;
};

export { Meta as CardMeta, Grid as CardGrid };
export { Meta as ACardMeta, Grid as ACardGrid };

export default Card as typeof Card &
Plugin & {
Expand Down
10 changes: 5 additions & 5 deletions components/checkbox/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import type { App, Plugin } from 'vue';
import Checkbox from './Checkbox';
import CheckboxGroup from './Group';
import ACheckboxGroup from './Group';
export type { CheckboxProps, CheckboxGroupProps, CheckboxOptionType } from './interface';
export { checkboxProps, checkboxGroupProps } from './interface';

Checkbox.Group = CheckboxGroup;
Checkbox.Group = ACheckboxGroup;

/* istanbul ignore next */
Checkbox.install = function (app: App) {
app.component(Checkbox.name, Checkbox);
app.component(CheckboxGroup.name, CheckboxGroup);
app.component(ACheckboxGroup.name, ACheckboxGroup);
return app;
};
export { CheckboxGroup };
export { ACheckboxGroup };
export default Checkbox as typeof Checkbox &
Plugin & {
readonly Group: typeof CheckboxGroup;
readonly Group: typeof ACheckboxGroup;
};
10 changes: 5 additions & 5 deletions components/collapse/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import type { App, Plugin } from 'vue';
import Collapse, { collapseProps } from './Collapse';
import CollapsePanel, { collapsePanelProps } from './CollapsePanel';
import ACollapsePanel, { collapsePanelProps } from './CollapsePanel';
export type { CollapseProps } from './Collapse';
export type { CollapsePanelProps } from './CollapsePanel';

Collapse.Panel = CollapsePanel;
Collapse.Panel = ACollapsePanel;

/* istanbul ignore next */
Collapse.install = function (app: App) {
app.component(Collapse.name, Collapse);
app.component(CollapsePanel.name, CollapsePanel);
app.component(ACollapsePanel.name, ACollapsePanel);
return app;
};

export { CollapsePanel, collapseProps, collapsePanelProps };
export { ACollapsePanel, collapseProps, collapsePanelProps };
export default Collapse as typeof Collapse &
Plugin & {
readonly Panel: typeof CollapsePanel;
readonly Panel: typeof ACollapsePanel;
};
Loading