feat: 动态更新页面标题以反映当前模式,增强用户体验

This commit is contained in:
xudan 2025-07-30 11:28:39 +08:00
parent def0eef355
commit d17ce3a8f6
2 changed files with 16 additions and 0 deletions

View File

@ -25,6 +25,16 @@ const isMonitorMode = computed(() => route.path.includes('/monitor'));
// //
const title = ref<string>(''); const title = ref<string>('');
//
watch(
isMonitorMode,
(isMonitor) => {
const mode = isMonitor ? '场景监控' : '场景仿真';
document.title = mode;
},
{ immediate: true },
);
// //
const container = shallowRef<HTMLDivElement>(); const container = shallowRef<HTMLDivElement>();
const editor = shallowRef<EditorService>(); const editor = shallowRef<EditorService>();

View File

@ -51,6 +51,12 @@ const pushScene = async () => {
//#endregion //#endregion
const title = ref<string>(''); const title = ref<string>('');
//
onMounted(() => {
document.title = '场景编辑器';
});
watch( watch(
() => props.id, () => props.id,
async () => { async () => {