feat: 更新主分支
This commit is contained in:
@@ -68,7 +68,12 @@ function hasOneShowingChild(
|
||||
}
|
||||
|
||||
function resolvePath(routePath) {
|
||||
return path.resolve(props.basePath, routePath);
|
||||
const httpReg = /^http(s?):\/\//;
|
||||
if (httpReg.test(routePath)) {
|
||||
return props.basePath + "/" + routePath;
|
||||
} else {
|
||||
return path.resolve(props.basePath, routePath);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@@ -5,6 +5,7 @@ import { getServerConfig } from "./config";
|
||||
import { createApp, Directive } from "vue";
|
||||
import { usI18n } from "../src/plugins/i18n";
|
||||
import { MotionPlugin } from "@vueuse/motion";
|
||||
import { useFontawesome } from "../src/plugins/fontawesome";
|
||||
import { useElementPlus } from "../src/plugins/element-plus";
|
||||
import { injectResponsiveStorage } from "/@/utils/storage/responsive";
|
||||
|
||||
@@ -26,7 +27,12 @@ Object.keys(directives).forEach(key => {
|
||||
getServerConfig(app).then(async config => {
|
||||
injectResponsiveStorage(app, config);
|
||||
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();
|
||||
app.mount("#app");
|
||||
});
|
||||
|
15
src/plugins/fontawesome/index.ts
Normal file
15
src/plugins/fontawesome/index.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/** 兼容fontawesome4和5版本
|
||||
* 4版本: www.fontawesome.com.cn/faicons/
|
||||
* 5版本:https://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);
|
||||
}
|
Reference in New Issue
Block a user