set page name

This commit is contained in:
Qiuxia Fan 2022-03-21 15:59:39 +08:00
parent 61f82c54df
commit 774ca4656f
2 changed files with 4 additions and 2 deletions

View File

@ -23,11 +23,13 @@ import { useRoute } from "vue-router";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { EntityType } from "./dashboard/data"; import { EntityType } from "./dashboard/data";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { useAppStoreWithOut } from "@/store/modules/app";
import Edit from "./dashboard/Edit.vue"; import Edit from "./dashboard/Edit.vue";
const { t } = useI18n(); const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const appStore = useAppStoreWithOut();
const routeNames = [ const routeNames = [
"GeneralServices", "GeneralServices",
"Database", "Database",
@ -56,6 +58,7 @@ async function getDashboard() {
} }
const d = dashboardStore.dashboards[index]; const d = dashboardStore.dashboards[index];
dashboardStore.setCurrentDashboard(d); dashboardStore.setCurrentDashboard(d);
appStore.setPageTitle(d.name);
} }
function setLayer(n: string) { function setLayer(n: string) {
switch (n) { switch (n) {
@ -95,7 +98,6 @@ function setLayer(n: string) {
} }
dashboardStore.setLayer(layer.value); dashboardStore.setLayer(layer.value);
dashboardStore.setEntity(EntityType[1].value); dashboardStore.setEntity(EntityType[1].value);
// appStore.setPageTitle(layer.value);
} }
watch( watch(
() => route.name, () => route.name,