feat: 更新主分支

This commit is contained in:
xiaoxian521
2021-11-13 14:50:58 +08:00
parent 668dcca2f9
commit 0f3d82a9b1
5 changed files with 81 additions and 2 deletions

View File

@@ -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>

View File

@@ -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");
});

View 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);
}