import Animation from '@/components/Animation/index.vue'; import GLink from '@/components/GLink/index.vue'; import OptionLink from '@/components/OptionLink/index.vue'; import Number from '@/components/Number/index.vue'; import Panel from '@/components/Panel/index.vue'; import Time from '@/components/Time/index.vue'; import Copy from '@/components/Copy/index.vue'; import EmptyData from '@/components/EmptyData/index.vue'; import DataPanel from '@/components/DataPanel/index.vue'; import DataPanelV2 from '@/components/v2/DataPanel/index.vue'; import RichLabel from '@/components/RichLabel/index.vue'; import Card from '@/components/Card/index.vue'; import Icon from '@/components/Icon/index.vue'; import UserAvatar from '@/components/UserAvatar/index.vue'; import GText from '@/components/GText/index.vue'; import GAvatar from '@/components/GAvatar/index.vue'; import GrayNumber from '@/components/v2/GrayNum/index.vue' const GLOBAL_COMPONENT_MAP = { GLink, OptionLink, Number, Panel, Time, Copy, EmptyData, DataPanel, RichLabel, Card, Icon, UserAvatar, GText, GAvatar, DataPanelV2, GrayNumber }; const GlobalComponentsPlugin = { install(app) { Object.entries(GLOBAL_COMPONENT_MAP).forEach(([name, component]) => { app.component(name, component); // 使用G开头重新声明组件(过渡阶段,后面统一使用G开头) if (!name.startsWith('G')) { app.component(`G${name}`, component); } }); } }; export default GlobalComponentsPlugin;