开始重构
This commit is contained in:
@@ -312,33 +312,34 @@ const addFloatingPanel = () => {
|
||||
showTitleBar: true,
|
||||
// 2. 向Area添加一个TabPage。TabPage的初始设置为填充满父容器
|
||||
tabPages: [
|
||||
{
|
||||
id: `tabpage-${areaIdCounter - 1}-1`,
|
||||
title: `标签页 1`,
|
||||
// TabPage填充满父容器
|
||||
width: 100,
|
||||
height: 100,
|
||||
// 3. 向TabPage添加一个Panel。Panel的初始设置为填充满父容器
|
||||
panels: [
|
||||
{
|
||||
id: `panel-${areaIdCounter - 1}-1-1`,
|
||||
title: `面板 ${areaIdCounter - 1}`,
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 100,
|
||||
height: 100,
|
||||
collapsed: false,
|
||||
toolbarExpanded: false,
|
||||
// 添加随机测试内容以便合并测试
|
||||
content: generateRandomContent(areaIdCounter - 1)
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
const newTabPage = {
|
||||
id: `tabpage-${areaIdCounter - 1}-1`,
|
||||
title: `标签页 1`,
|
||||
// TabPage填充满父容器
|
||||
width: 100,
|
||||
height: 100,
|
||||
// 3. 向TabPage添加一个Panel。Panel的初始设置为填充满父容器
|
||||
panels: [
|
||||
]
|
||||
}
|
||||
const newPanel = {
|
||||
id: `panel-${areaIdCounter - 1}-1-1`,
|
||||
title: `面板 ${areaIdCounter - 1}`,
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 100,
|
||||
height: 100,
|
||||
collapsed: false,
|
||||
toolbarExpanded: false,
|
||||
// 添加随机测试内容以便合并测试
|
||||
content: generateRandomContent(areaIdCounter - 1)
|
||||
}
|
||||
newTabPage.panels.push(newPanel)
|
||||
newArea.tabPages.push(newTabPage)
|
||||
floatingAreas.value.push(newArea)
|
||||
}
|
||||
|
||||
// 更新区域位置
|
||||
const onUpdatePosition = (id, position) => {
|
||||
const area = floatingAreas.value.find(a => a.id === id)
|
||||
|
||||
Reference in New Issue
Block a user