perf: 同步完整版分支代码

This commit is contained in:
xiaoxian521
2021-12-11 11:17:21 +08:00
parent 3f8f7eede9
commit 8381410ff4
4 changed files with 211 additions and 143 deletions

View File

@@ -41,29 +41,15 @@ import {
ElTabPane,
ElAvatar,
ElEmpty,
ElCollapse,
ElCollapseItem,
// 指令
ElLoading,
ElInfiniteScroll
} from "element-plus";
// https://element-plus.org/zh-CN/component/icon.html
import {
Check,
Menu,
HomeFilled,
SetUp,
Edit,
Setting,
Lollipop,
Link,
Position,
Histogram,
RefreshRight,
ArrowDown,
Close,
CloseBold,
Bell
} from "@element-plus/icons";
// Directives
const plugins = [ElLoading, ElInfiniteScroll];
const components = [
ElTag,
@@ -106,9 +92,31 @@ const components = [
ElTabs,
ElTabPane,
ElAvatar,
ElEmpty
ElEmpty,
ElCollapse,
ElCollapseItem
];
// icon
// https://element-plus.org/zh-CN/component/icon.html
import {
Check,
Menu,
HomeFilled,
SetUp,
Edit,
Setting,
Lollipop,
Link,
Position,
Histogram,
RefreshRight,
ArrowDown,
Close,
CloseBold,
Bell
} from "@element-plus/icons-vue";
// Icon
export const iconComponents = [
Check,
Menu,
@@ -127,14 +135,17 @@ export const iconComponents = [
Bell
];
const plugins = [ElLoading, ElInfiniteScroll];
export function useElementPlus(app: App) {
components.push(...iconComponents);
// 注册组件
components.forEach((component: Component) => {
app.component(component.name, component);
});
// 注册指令
plugins.forEach(plugin => {
app.use(plugin);
});
// 注册图标
iconComponents.forEach((component: Component) => {
app.component(component.name, component);
});
}