fix: table max width

This commit is contained in:
2026-02-26 17:24:25 +08:00
parent af4cb15d2c
commit d171e7b094
3 changed files with 27 additions and 17 deletions
+19 -17
View File
@@ -145,7 +145,7 @@ customElement('md-table', { roll: false, remix: false }, (props, { element }) =>
return (
<div class="ttrpg-table">
<div class="flex items-center gap-2 border-b border-gray-200">
<div class="flex flex-col w-full">
<div class="flex flex-col overflow-x-auto">
{/* 分组 tabs */}
<Show when={hasGroup()}>
<div class="flex gap-2 border-b border-gray-100 pb-2">
@@ -176,30 +176,32 @@ customElement('md-table', { roll: false, remix: false }, (props, { element }) =>
</div>
</Show>
{/* 内容 tabs */}
<div class="flex gap-2">
<div class="flex items-center gap-2">
<Show when={props.roll}>
<button
onClick={handleRoll}
class="text-gray-500 hover:text-gray-700"
class="text-gray-500 hover:text-gray-700 flex-shrink-0"
title="随机切换"
>
🎲
</button>
</Show>
<For each={filteredRows()}>
{(row, index) => (
<button
onClick={() => setActiveTab(index())}
class={`font-medium transition-colors ${
activeTab() === index()
? 'text-blue-600 border-b-2 border-blue-600'
: 'text-gray-500 hover:text-gray-700'
}`}
>
{row.label}
</button>
)}
</For>
<div class="flex gap-2 overflow-x-auto flex-1 min-w-0">
<For each={filteredRows()}>
{(row, index) => (
<button
onClick={() => setActiveTab(index())}
class={`font-medium transition-colors flex-shrink-0 ${
activeTab() === index()
? 'text-blue-600 border-b-2 border-blue-600'
: 'text-gray-500 hover:text-gray-700'
}`}
>
{row.label}
</button>
)}
</For>
</div>
</div>
</div>
</div>