Fix: 修复终端标签切换时重连问题
将终端工作区提升为主布局常驻层,离开终端路由时只隐藏不卸载组件。 新增活动终端显隐状态跟踪,页面恢复时自动重新适配尺寸和聚焦。 改动范围: - frontend/src/layouts/MainLayout.vue - frontend/src/views/TerminalWorkspaceView.vue - frontend/src/components/TerminalWidget.vue
This commit is contained in:
@@ -4,6 +4,10 @@ import { useTerminalTabsStore } from '../stores/terminalTabs'
|
||||
import { useConnectionsStore } from '../stores/connections'
|
||||
import TerminalWidget from '../components/TerminalWidget.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
visible?: boolean
|
||||
}>()
|
||||
|
||||
const tabsStore = useTerminalTabsStore()
|
||||
const connectionsStore = useConnectionsStore()
|
||||
|
||||
@@ -34,7 +38,10 @@ onMounted(() => {
|
||||
v-show="tab.active"
|
||||
class="h-full"
|
||||
>
|
||||
<TerminalWidget :connection-id="tab.connectionId" />
|
||||
<TerminalWidget
|
||||
:connection-id="tab.connectionId"
|
||||
:active="tab.active && props.visible !== false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user