Skip to content

Commit 95ad07c

Browse files
committed
优化表达式编辑器布局:1. 针对垂直布局下的变量区域添加最大高度设置;2. 将固定高度改为最大高度,以提升布局灵活性。
1 parent d77e797 commit 95ad07c

File tree

2 files changed

+7
-32
lines changed

2 files changed

+7
-32
lines changed

src/components/ExpressionEditor.vue

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,44 +1801,20 @@ onMounted(() => {
18011801
.variables-section {
18021802
display: flex;
18031803
flex-direction: column;
1804-
min-height: 200px;
18051804
1806-
// 优化变量区域的布局
1805+
// 针对垂直布局下的变量区域添加最大高度设置
1806+
@at-root .editor-content:not(.horizontal-layout) & {
1807+
max-height: 300px; // 最大高度,内容少时自适应,高内容时出现滚动条
1808+
}
1809+
1810+
// ...existing code...
18071811
.variables-search {
18081812
margin-bottom: 12px;
18091813
flex-shrink: 0; // 防止搜索框被压缩
18101814
}
1811-
18121815
.variables {
18131816
flex: 1;
18141817
overflow: auto;
1815-
1816-
// 变量少时不强制占满空间
1817-
&:only-child {
1818-
flex: 0 1 auto;
1819-
}
1820-
1821-
// 优化滚动条样式
1822-
&::-webkit-scrollbar {
1823-
width: 6px;
1824-
}
1825-
1826-
&::-webkit-scrollbar-thumb {
1827-
background-color: var(--el-border-color-lighter);
1828-
border-radius: 3px;
1829-
}
1830-
1831-
&::-webkit-scrollbar-track {
1832-
background-color: transparent;
1833-
}
1834-
1835-
button {
1836-
margin-bottom: 8px;
1837-
1838-
&:last-child {
1839-
margin-bottom: 0;
1840-
}
1841-
}
18421818
}
18431819
}
18441820
}

src/components/styles/layout.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
max-width: 320px;
1919
display: flex;
2020
flex-direction: column;
21-
height: 320px; // 设置固定高度
21+
max-height: 320px; // 设置固定高度
2222
min-height: 120px;
2323
margin-bottom: v.$spacing-md; // 添加底部间距
2424

@@ -131,7 +131,6 @@
131131
display: flex;
132132
flex-direction: column;
133133
gap: v.$spacing-xs;
134-
height: 320px;
135134
margin: 0 auto;
136135
padding-right: v.$spacing-xs; // 添加右侧内边距
137136
transition: all 0.3s ease;

0 commit comments

Comments
 (0)