feat: 动态更新页面标题

This commit is contained in:
2024-08-29 14:46:06 +08:00
parent 94e94956bb
commit 702d65ef47
2 changed files with 17 additions and 0 deletions

9
src/assets/js/utils.js Normal file
View File

@@ -0,0 +1,9 @@
import { description as appDesc } from '@package-json';
/**
* @description 更新页面标题
* @param {string} title
*/
export function updateAppTitle(title = '') {
document.title = (title ? `${title} - ${appDesc}` : appDesc);
}