mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-18 10:10:43 +08:00
🐛 修复页面标题异常
This commit is contained in:
parent
7a2e22c30c
commit
61fe45927e
@ -41,7 +41,11 @@ const routerOptions = {
|
||||
const router = createRouter(routerOptions);
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import config from '@/config';
|
||||
|
||||
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, () => {
|
||||
if (info.value) {
|
||||
pageTitle(info.value?.Name, '节点详情');
|
||||
watch(() => info.value, (oldValue, newValue) => {
|
||||
if (!oldValue && newValue && router.currentRoute.value.name === 'ServerDetail') {
|
||||
pageTitle(newValue?.Name, '节点详情');
|
||||
handleWorldMapWidth();
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user