This commit is contained in:
xiaojunnuo
2025-03-11 01:14:14 +08:00
parent 832b74b66b
commit 31718d1a4a
2 changed files with 5 additions and 1 deletions
@@ -10,13 +10,17 @@ import "./styles/antd/index.css";
import { useTitle } from "@vueuse/core";
import { setupI18n } from "/@/vben/locales";
import { useSettingStore } from "/@/store/modules/settings";
export async function setupVben(app: any, { loadMessages, router }: any) {
await setupI18n(app, { loadMessages });
const store = await initStores(app, { namespace: "fs" });
const settingStore = useSettingStore();
watchEffect(() => {
if (preferences.app.dynamicTitle) {
const routeTitle = router.currentRoute.value.meta?.title;
const appName = settingStore.inited ? preferences.app.name : "";
const pageTitle = (routeTitle ? `${routeTitle} - ` : "") + preferences.app.name;
useTitle(pageTitle);
}