修复添加浮动窗口功能:优化Panel组件状态同步和添加调试日志

This commit is contained in:
zqm
2025-10-30 21:11:44 +08:00
parent 3b34f3a0dc
commit 05626e31ff
2 changed files with 21 additions and 9 deletions

View File

@@ -76,17 +76,19 @@ const panelHost = ref(null);
// 浮动面板列表
const floatingPanels = ref([]);
let nextPanelIdx = 1;
// 使用响应式数据存储面板索引,确保正确更新
const nextPanelIdx = ref(1);
function addPanel(position) {
console.log('[DockLayoutTest] addPanel clicked:', position);
}
function addFloatingPanel() {
console.log('[DockLayoutTest] addFloatingPanel called');
// 复原截图样式的默认面板参数
const defaultSize = { width: 300, height: 180 };
const offset = 16;
const idx = nextPanelIdx++;
const idx = nextPanelIdx.value++;
const panel = {
id: 'float-' + idx,
title: '输出',
@@ -98,7 +100,9 @@ function addFloatingPanel() {
toolbarExpanded: false,
maximized: false,
};
console.log('[DockLayoutTest] Adding panel:', panel);
floatingPanels.value.push(panel);
console.log('[DockLayoutTest] Panels after add:', floatingPanels.value.length);
}
function closePanel(id) {