mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 16:44:15 +08:00
修复收起图表列时表头换行顶高的问题
- 根因: 收起时列宽压到 44px, 分时表头「眼睛按钮+排序箭头+内边距」 约 62px 放不下, 排序箭头被挤到第二行, 表头行被顶到 63~81px - 修复: 表头单元格统一 whitespace-nowrap (表头不应折行, 长标签同样 受益); 日k/分时列收起态隐藏文字标签只留眼睛按钮, 列保持紧凑 - 验证: 收起态行高 43px 单行(日k 44px/分时 56px), 展开态 41px
This commit is contained in:
@@ -43,9 +43,10 @@ export interface StockDataTableProps {
|
||||
}
|
||||
|
||||
function alignThClass(align: ColumnConfig['align']): string {
|
||||
if (align === 'right') return 'px-3 py-2.5 font-medium text-right'
|
||||
if (align === 'center') return 'px-3 py-2.5 font-medium text-center'
|
||||
return 'px-3 py-2.5 font-medium'
|
||||
// 表头一律不换行: 窄列(如收起的图表列)中标签/排序箭头折行会把整行表头顶高
|
||||
if (align === 'right') return 'px-3 py-2.5 font-medium text-right whitespace-nowrap'
|
||||
if (align === 'center') return 'px-3 py-2.5 font-medium text-center whitespace-nowrap'
|
||||
return 'px-3 py-2.5 font-medium whitespace-nowrap'
|
||||
}
|
||||
|
||||
export function StockDataTable({
|
||||
|
||||
@@ -1525,7 +1525,8 @@ export function Watchlist() {
|
||||
if (col.source.type === 'builtin' && col.source.key === 'candle') {
|
||||
return (
|
||||
<span className="inline-flex items-center justify-center gap-1.5">
|
||||
<span>{col.label}</span>
|
||||
{/* 收起态只留眼睛按钮, 避免标签在窄列内换行顶高表头 */}
|
||||
{dailyKChartVisible && <span className="shrink-0 whitespace-nowrap">{col.label}</span>}
|
||||
<button
|
||||
type="button"
|
||||
onClick={(event) => { event.stopPropagation(); toggleDailyKChart() }}
|
||||
@@ -1546,7 +1547,7 @@ export function Watchlist() {
|
||||
const intradayAutoRefresh = intradayRefreshEnabled && realtimeRunning
|
||||
return (
|
||||
<span className="inline-flex items-center justify-center gap-1.5">
|
||||
<span>{col.label}</span>
|
||||
{intradayChartVisible && <span className="shrink-0 whitespace-nowrap">{col.label}</span>}
|
||||
<button
|
||||
type="button"
|
||||
onClick={(event) => { event.stopPropagation(); toggleIntradayChart() }}
|
||||
|
||||
Reference in New Issue
Block a user