Browse Source

feat: 更新主分支

i18n
xiaoxian521 3 years ago
parent
commit
0f3d82a9b1
  1. 3
      package.json
  2. 50
      pnpm-lock.yaml
  3. 5
      src/layout/components/sidebar/sidebarItem.vue
  4. 8
      src/main.ts
  5. 15
      src/plugins/fontawesome/index.ts

3
package.json

@ -29,6 +29,9 @@
], ],
"dependencies": { "dependencies": {
"@element-plus/icons": "^0.0.11", "@element-plus/icons": "^0.0.11",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/vue-fontawesome": "^3.0.0-5",
"@vueuse/core": "^6.7.1", "@vueuse/core": "^6.7.1",
"@vueuse/motion": "^2.0.0-beta.4", "@vueuse/motion": "^2.0.0-beta.4",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",

50
pnpm-lock.yaml

@ -4,6 +4,9 @@ specifiers:
"@commitlint/cli": 13.1.0 "@commitlint/cli": 13.1.0
"@commitlint/config-conventional": 13.1.0 "@commitlint/config-conventional": 13.1.0
"@element-plus/icons": ^0.0.11 "@element-plus/icons": ^0.0.11
"@fortawesome/fontawesome-svg-core": ^1.2.36
"@fortawesome/free-solid-svg-icons": ^5.15.4
"@fortawesome/vue-fontawesome": ^3.0.0-5
"@types/element-resize-detector": 1.1.3 "@types/element-resize-detector": 1.1.3
"@types/mockjs": 1.0.3 "@types/mockjs": 1.0.3
"@types/node": 14.14.14 "@types/node": 14.14.14
@ -70,6 +73,9 @@ specifiers:
dependencies: dependencies:
"@element-plus/icons": 0.0.11 "@element-plus/icons": 0.0.11
"@fortawesome/fontawesome-svg-core": 1.2.36
"@fortawesome/free-solid-svg-icons": 5.15.4
"@fortawesome/vue-fontawesome": 3.0.0-5_a4ef6aa86ab1c63b266771040e7bf2c7
"@vueuse/core": 6.7[email protected] "@vueuse/core": 6.7[email protected]
"@vueuse/motion": 2.0.0-[email protected] "@vueuse/motion": 2.0.0-[email protected]
animate.css: 4.1.1 animate.css: 4.1.1
@ -756,6 +762,50 @@ packages:
- supports-color - supports-color
dev: true dev: true
/@fortawesome/fontawesome-common-types/0.2.36:
resolution:
{
integrity: sha512-a/7BiSgobHAgBWeN7N0w+lAhInrGxksn13uK7231n2m8EDPE3BMCl9NZLTGrj9ZXfCmC6LM0QLqXidIizVQ6yg==
}
engines: { node: ">=6" }
requiresBuild: true
dev: false
/@fortawesome/fontawesome-svg-core/1.2.36:
resolution:
{
integrity: sha512-YUcsLQKYb6DmaJjIHdDWpBIGCcyE/W+p/LMGvjQem55Mm2XWVAP5kWTMKWLv9lwpCVjpLxPyOMOyUocP1GxrtA==
}
engines: { node: ">=6" }
requiresBuild: true
dependencies:
"@fortawesome/fontawesome-common-types": 0.2.36
dev: false
/@fortawesome/free-solid-svg-icons/5.15.4:
resolution:
{
integrity: sha512-JLmQfz6tdtwxoihXLg6lT78BorrFyCf59SAwBM6qV/0zXyVeDygJVb3fk+j5Qat+Yvcxp1buLTY5iDh1ZSAQ8w==
}
engines: { node: ">=6" }
requiresBuild: true
dependencies:
"@fortawesome/fontawesome-common-types": 0.2.36
dev: false
/@fortawesome/vue-fontawesome/3.0.0-5_a4ef6aa86ab1c63b266771040e7bf2c7:
resolution:
{
integrity: sha512-aNmBT4bOecrFsZTog1l6AJDQHPP3ocXV+WQ3Ogy8WZCqstB/ahfhH4CPu5i4N9Hw0MBKXqE+LX+NbUxcj8cVTw==
}
peerDependencies:
"@fortawesome/fontawesome-svg-core": ~1 || >=1.3.0-beta1
vue: ">= 3.0.0 < 4"
dependencies:
"@fortawesome/fontawesome-svg-core": 1.2.36
vue: 3.2.21
dev: false
/@humanwhocodes/config-array/0.5.0: /@humanwhocodes/config-array/0.5.0:
resolution: resolution:
{ {

5
src/layout/components/sidebar/sidebarItem.vue

@ -68,8 +68,13 @@ function hasOneShowingChild(
} }
function resolvePath(routePath) { function resolvePath(routePath) {
const httpReg = /^http(s?):\/\//;
if (httpReg.test(routePath)) {
return props.basePath + "/" + routePath;
} else {
return path.resolve(props.basePath, routePath); return path.resolve(props.basePath, routePath);
} }
}
</script> </script>
<template> <template>

8
src/main.ts

@ -5,6 +5,7 @@ import { getServerConfig } from "./config";
import { createApp, Directive } from "vue"; import { createApp, Directive } from "vue";
import { usI18n } from "../src/plugins/i18n"; import { usI18n } from "../src/plugins/i18n";
import { MotionPlugin } from "@vueuse/motion"; import { MotionPlugin } from "@vueuse/motion";
import { useFontawesome } from "../src/plugins/fontawesome";
import { useElementPlus } from "../src/plugins/element-plus"; import { useElementPlus } from "../src/plugins/element-plus";
import { injectResponsiveStorage } from "/@/utils/storage/responsive"; import { injectResponsiveStorage } from "/@/utils/storage/responsive";
@ -26,7 +27,12 @@ Object.keys(directives).forEach(key => {
getServerConfig(app).then(async config => { getServerConfig(app).then(async config => {
injectResponsiveStorage(app, config); injectResponsiveStorage(app, config);
setupStore(app); setupStore(app);
app.use(router).use(MotionPlugin).use(useElementPlus).use(usI18n);
app
.use(router)
.use(MotionPlugin)
.use(useElementPlus)
.use(usI18n)
.use(useFontawesome);
await router.isReady(); await router.isReady();
app.mount("#app"); app.mount("#app");
}); });

15
src/plugins/fontawesome/index.ts

@ -0,0 +1,15 @@
/** fontawesome45
* 4版本: www.fontawesome.com.cn/faicons/
* 5https://fontawesome.com/v5.15/icons?d=gallery&p=2&m=free
* https://github.com/FortAwesome/vue-fontawesome
*/
import { App } from "vue";
import "font-awesome/css/font-awesome.css";
import { library } from "@fortawesome/fontawesome-svg-core";
import { faUserSecret } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
export function useFontawesome(app: App) {
library.add(faUserSecret);
app.component("font-awesome-icon", FontAwesomeIcon);
}
Loading…
Cancel
Save