{
class="el-icon-refresh-right rotate"
@click="onFresh"
>
-
+
-
+
diff --git a/src/layout/index.vue b/src/layout/index.vue
index 9b0d3a7..cfc751d 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -11,14 +11,15 @@ import { setType } from "./types";
import { useI18n } from "vue-i18n";
import { routerArrays } from "./types";
import { emitter } from "/@/utils/mitt";
-import backTop from "/@/assets/svg/back_top.svg";
import { useAppStoreHook } from "/@/store/modules/app";
-import fullScreen from "/@/assets/svg/full_screen.svg";
-import exitScreen from "/@/assets/svg/exit_screen.svg";
import { deviceDetection } from "/@/utils/deviceDetection";
import { useMultiTagsStore } from "/@/store/modules/multiTags";
import { useSettingStoreHook } from "/@/store/modules/settings";
+import backTop from "/@/assets/svg/back_top.svg?component";
+import fullScreen from "/@/assets/svg/full_screen.svg?component";
+import exitScreen from "/@/assets/svg/exit_screen.svg?component";
+
import navbar from "./components/navbar.vue";
import tag from "./components/tag/index.vue";
import appMain from "./components/appMain.vue";
diff --git a/src/layout/types.ts b/src/layout/types.ts
index cc15cc5..db3f158 100644
--- a/src/layout/types.ts
+++ b/src/layout/types.ts
@@ -1,3 +1,4 @@
+import { Component } from "vue";
export const routerArrays: Array = [
{
path: "/welcome",
@@ -5,7 +6,7 @@ export const routerArrays: Array = [
meta: {
title: "menus.hshome",
i18n: true,
- icon: "HomeFilled",
+ icon: "home-filled",
showLink: true
}
}
@@ -32,7 +33,7 @@ export type multiTagsType = {
};
export type tagsViewsType = {
- icon: string;
+ icon: Component;
text: string;
divided: boolean;
disabled: boolean;
diff --git a/src/main.ts b/src/main.ts
index 25527c4..6d5d507 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -25,6 +25,11 @@ Object.keys(directives).forEach(key => {
app.directive(key, (directives as { [key: string]: Directive })[key]);
});
+// 全局注册`@iconify/vue`图标库
+import { IconifyIconOffline, IconifyIconOnline } from "./components/ReIcon";
+app.component("IconifyIconOffline", IconifyIconOffline);
+app.component("IconifyIconOnline", IconifyIconOnline);
+
getServerConfig(app).then(async config => {
injectResponsiveStorage(app, config);
setupStore(app);
diff --git a/src/plugins/element-plus/index.ts b/src/plugins/element-plus/index.ts
index 0a957a4..dc05ce1 100644
--- a/src/plugins/element-plus/index.ts
+++ b/src/plugins/element-plus/index.ts
@@ -99,58 +99,6 @@ const components = [
ElTreeV2
];
-// 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,
- Guide,
- User,
- Iphone,
- Location,
- Tickets,
- OfficeBuilding,
- Notebook
-} from "@element-plus/icons-vue";
-
-// Icon
-export const iconComponents = [
- Check,
- Menu,
- HomeFilled,
- SetUp,
- Edit,
- Setting,
- Lollipop,
- Link,
- Position,
- Histogram,
- RefreshRight,
- ArrowDown,
- Close,
- CloseBold,
- Bell,
- Guide,
- User,
- Iphone,
- Location,
- Tickets,
- OfficeBuilding,
- Notebook
-];
-
export function useElementPlus(app: App) {
// 注册组件
components.forEach((component: Component) => {
@@ -160,8 +108,4 @@ export function useElementPlus(app: App) {
plugins.forEach(plugin => {
app.use(plugin);
});
- // 注册图标
- iconComponents.forEach((component: Component) => {
- app.component(component.name, component);
- });
}
diff --git a/src/router/modules/error.ts b/src/router/modules/error.ts
index 1166a26..603da7d 100644
--- a/src/router/modules/error.ts
+++ b/src/router/modules/error.ts
@@ -7,7 +7,7 @@ const errorRouter = {
component: Layout,
redirect: "/error/401",
meta: {
- icon: "Position",
+ icon: "position",
title: $t("menus.hserror"),
showLink: true,
i18n: true,
diff --git a/src/router/modules/externalLink.ts b/src/router/modules/externalLink.ts
index b851f8f..72adc83 100644
--- a/src/router/modules/externalLink.ts
+++ b/src/router/modules/externalLink.ts
@@ -6,7 +6,7 @@ const externalLink = {
name: "external",
component: Layout,
meta: {
- icon: "Link",
+ icon: "link",
title: $t("menus.externalLink"),
showLink: true,
i18n: true,
diff --git a/src/router/modules/home.ts b/src/router/modules/home.ts
index f5b1f0a..b34709d 100644
--- a/src/router/modules/home.ts
+++ b/src/router/modules/home.ts
@@ -7,7 +7,7 @@ const homeRouter = {
component: Layout,
redirect: "/welcome",
meta: {
- icon: "HomeFilled",
+ icon: "home-filled",
title: $t("menus.hshome"),
showLink: true,
i18n: true,
diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts
index 64d2327..a16c944 100644
--- a/src/router/modules/remaining.ts
+++ b/src/router/modules/remaining.ts
@@ -18,7 +18,7 @@ const remainingRouter = [
name: "redirect",
component: Layout,
meta: {
- icon: "HomeFilled",
+ icon: "home-filled",
title: $t("menus.hshome"),
i18n: true,
showLink: false,
diff --git a/src/store/modules/multiTags.ts b/src/store/modules/multiTags.ts
index 82f356a..3a52128 100644
--- a/src/store/modules/multiTags.ts
+++ b/src/store/modules/multiTags.ts
@@ -16,7 +16,7 @@ export const useMultiTagsStore = defineStore({
parentPath: "/",
meta: {
title: "menus.hshome",
- icon: "HomeFilled",
+ icon: "home-filled",
i18n: true,
showLink: true
}
diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts
index 49ba5d9..0fb9578 100644
--- a/src/store/modules/user.ts
+++ b/src/store/modules/user.ts
@@ -59,7 +59,7 @@ export const useUserStore = defineStore({
parentPath: "/",
meta: {
title: "menus.hshome",
- icon: "HomeFilled",
+ icon: "home-filled",
i18n: true,
showLink: true
}
diff --git a/src/utils/storage/responsive.ts b/src/utils/storage/responsive.ts
index 2162e82..fa0a461 100644
--- a/src/utils/storage/responsive.ts
+++ b/src/utils/storage/responsive.ts
@@ -47,7 +47,7 @@ export const injectResponsiveStorage = (app: App, config: ServerConfigs) => {
meta: {
title: "menus.hshome",
i18n: true,
- icon: "HomeFilled",
+ icon: "home-filled",
showLink: true
}
}
diff --git a/src/views/login.vue b/src/views/login.vue
index 68a853b..b229c33 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -5,14 +5,14 @@ import { initRouter } from "/@/router/utils";
import { storageSession } from "/@/utils/storage";
import { addClass, removeClass } from "/@/utils/operate";
import bg from "/@/assets/login/bg.png";
-import avatar from "/@/assets/login/avatar.svg";
-import illustration0 from "/@/assets/login/illustration0.svg";
-import illustration1 from "/@/assets/login/illustration1.svg";
-import illustration2 from "/@/assets/login/illustration2.svg";
-import illustration3 from "/@/assets/login/illustration3.svg";
-import illustration4 from "/@/assets/login/illustration4.svg";
-import illustration5 from "/@/assets/login/illustration5.svg";
-import illustration6 from "/@/assets/login/illustration6.svg";
+import avatar from "/@/assets/login/avatar.svg?component";
+import illustration0 from "/@/assets/login/illustration0.svg?component";
+import illustration1 from "/@/assets/login/illustration1.svg?component";
+import illustration2 from "/@/assets/login/illustration2.svg?component";
+import illustration3 from "/@/assets/login/illustration3.svg?component";
+import illustration4 from "/@/assets/login/illustration4.svg?component";
+import illustration5 from "/@/assets/login/illustration5.svg?component";
+import illustration6 from "/@/assets/login/illustration6.svg?component";
const router = useRouter();
diff --git a/types/global.d.ts b/types/global.d.ts
index 395419c..dfb9c71 100644
--- a/types/global.d.ts
+++ b/types/global.d.ts
@@ -6,16 +6,15 @@ import type {
PropType as VuePropType
} from "vue";
+// GlobalComponents for Volar
+declare module "vue" {
+ export interface GlobalComponents {
+ IconifyIconOffline: typeof import("../src/components/ReIcon")["IconifyIconOffline"];
+ IconifyIconOnline: typeof import("../src/components/ReIcon")["IconifyIconOnline"];
+ }
+}
+
declare global {
- const __APP_INFO__: {
- pkg: {
- name: string;
- version: string;
- dependencies: Recordable;
- devDependencies: Recordable;
- };
- lastBuildTime: string;
- };
interface Window {
// Global vue app instance
__APP__: App;
@@ -23,7 +22,6 @@ declare global {
mozCancelAnimationFrame: (handle: number) => void;
oCancelAnimationFrame: (handle: number) => void;
msCancelAnimationFrame: (handle: number) => void;
-
webkitRequestAnimationFrame: (callback: FrameRequestCallback) => number;
mozRequestAnimationFrame: (callback: FrameRequestCallback) => number;
oRequestAnimationFrame: (callback: FrameRequestCallback) => number;
diff --git a/windi.config.ts b/windi.config.ts
index 9d7a3b1..258d3c1 100644
--- a/windi.config.ts
+++ b/windi.config.ts
@@ -6,7 +6,6 @@ import typography from "windicss/plugin/typography";
export default defineConfig({
darkMode: "class",
attributify: true,
-
plugins: [typography()],
theme: {
extend: {