mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-17 01:30:44 +08:00
🐛 修复页面标题异常
This commit is contained in:
parent
7a2e22c30c
commit
61fe45927e
@ -41,7 +41,11 @@ const routerOptions = {
|
|||||||
const router = createRouter(routerOptions);
|
const router = createRouter(routerOptions);
|
||||||
|
|
||||||
router.beforeResolve((to, from, next) => {
|
router.beforeResolve((to, from, next) => {
|
||||||
pageTitle(to?.meta?.title);
|
if (to?.meta?.title) {
|
||||||
|
pageTitle(to?.meta?.title);
|
||||||
|
} else if (to.name === 'Home') {
|
||||||
|
pageTitle(config.nazhua.title);
|
||||||
|
}
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import config from '@/config';
|
import config from '@/config';
|
||||||
|
|
||||||
export default (...args) => {
|
export default (...args) => {
|
||||||
document.title = [...args, config.nazhua.title].filter((i) => i).join(' - ');
|
const titles = [...new Set([...args, config.nazhua.title])].filter((i) => i);
|
||||||
|
document.title = titles.join(' - ');
|
||||||
};
|
};
|
||||||
|
|||||||
@ -130,9 +130,9 @@ function handleWorldMapWidth() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => info.value, () => {
|
watch(() => info.value, (oldValue, newValue) => {
|
||||||
if (info.value) {
|
if (!oldValue && newValue && router.currentRoute.value.name === 'ServerDetail') {
|
||||||
pageTitle(info.value?.Name, '节点详情');
|
pageTitle(newValue?.Name, '节点详情');
|
||||||
handleWorldMapWidth();
|
handleWorldMapWidth();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user