diff --git a/src/composables/useProjects.js b/src/composables/useProjects.js index 3201800..ce20c37 100644 --- a/src/composables/useProjects.js +++ b/src/composables/useProjects.js @@ -20,17 +20,19 @@ if (_distinctUrls.length) { // 读取已注册模块列表,供 TabNav 渲染页签。 // hidden 模块(如日历页)默认不显示在导航中,但当用户正在访问该页时 // 仍显示其页签(描下边高亮),让用户知道当前所在位置。 -// requiresAlive 模块:探测返回前不显示(避免闪烁);挂掉则保持隐藏。 +// requiresAlive 模块:乐观显示 -- 探测中(pending)与存活(up)均显示, +// 仅当明确探测为不可达(down)时才隐藏。这样首屏即可看到页签,探测完成 +// 仅在「服务挂掉」这一种情况下才把页签收掉。 export function useProjects() { const route = useRoute() const projects = computed(() => modules.filter((m) => { // 隐藏模块:仅当前正在访问时才显示 if (m.hidden && m.id !== route.meta.moduleId) return false - // 依赖存活的模块:pending/down 时不显示,up 时显示 + // 依赖存活的模块:仅 down 时隐藏;pending/up 都显示 if (m.requiresAlive) { const state = getLiveness(m.requiresAlive) - if (state.value !== 'up') return false + if (state.value === 'down') return false } return true }) diff --git a/src/config/app.config.js b/src/config/app.config.js index 1e38db1..d67842a 100644 --- a/src/config/app.config.js +++ b/src/config/app.config.js @@ -12,7 +12,7 @@ export const appConfig = { // 记事本页面路径生成器 pagePath: (boardId) => `/wb/${encodeURIComponent(boardId)}`, // 默认打开的记事本 id - defaultBoardId: 'shared', + defaultBoardId: 'share', // 探测超时(毫秒) healthTimeoutMs: 4000 } diff --git a/src/i18n/locales/en.js b/src/i18n/locales/en.js index a64a5e3..881fbd2 100644 --- a/src/i18n/locales/en.js +++ b/src/i18n/locales/en.js @@ -15,7 +15,9 @@ export default { whiteboard: 'Shared Notepad' }, whiteboard: { - openExternal: 'Open in new tab' + openExternal: 'Open in new tab', + boardId: 'Board ID', + switch: 'Switch' }, mobileGame: { hero: { diff --git a/src/i18n/locales/zh-CN.js b/src/i18n/locales/zh-CN.js index f2af543..e45c55d 100644 --- a/src/i18n/locales/zh-CN.js +++ b/src/i18n/locales/zh-CN.js @@ -14,7 +14,9 @@ export default { whiteboard: '共享记事本' }, whiteboard: { - openExternal: '在新标签页打开' + openExternal: '在新标签页打开', + boardId: '白板 ID', + switch: '切换' }, mobileGame: { hero: { diff --git a/src/modules/whiteboard/Whiteboard.vue b/src/modules/whiteboard/Whiteboard.vue index d625aeb..75a1bae 100644 --- a/src/modules/whiteboard/Whiteboard.vue +++ b/src/modules/whiteboard/Whiteboard.vue @@ -1,23 +1,70 @@