chore: useTitle

This commit is contained in:
xiaojunnuo
2025-03-09 01:14:44 +08:00
parent 065713cdb6
commit 2c6d64976f
3 changed files with 12 additions and 4 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ export async function setupVben(app: any, { loadMessages, router }: any) {
const store = await initStores(app, { namespace: "fs" });
watchEffect(() => {
if (preferences.app.dynamicTitle) {
const routeTitle = router.currentRoute.value.title;
const pageTitle = routeTitle || "" + preferences.app.name;
const routeTitle = router.currentRoute.value.meta?.title;
const pageTitle = (routeTitle ? `${routeTitle} - ` : "") + preferences.app.name;
useTitle(pageTitle);
}
});