feat: 动态更新页面标题以反映当前模式,增强用户体验
This commit is contained in:
parent
def0eef355
commit
d17ce3a8f6
@ -25,6 +25,16 @@ const isMonitorMode = computed(() => route.path.includes('/monitor'));
|
||||
// 场景标题
|
||||
const title = ref<string>('');
|
||||
|
||||
// 监听标题变化,动态更新页面标题
|
||||
watch(
|
||||
isMonitorMode,
|
||||
(isMonitor) => {
|
||||
const mode = isMonitor ? '场景监控' : '场景仿真';
|
||||
document.title = mode;
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
// 服务实例
|
||||
const container = shallowRef<HTMLDivElement>();
|
||||
const editor = shallowRef<EditorService>();
|
||||
|
@ -51,6 +51,12 @@ const pushScene = async () => {
|
||||
//#endregion
|
||||
|
||||
const title = ref<string>('');
|
||||
|
||||
// 监听标题变化,动态更新页面标题
|
||||
onMounted(() => {
|
||||
document.title = '场景编辑器';
|
||||
});
|
||||
|
||||
watch(
|
||||
() => props.id,
|
||||
async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user