将TabPage中的span关闭按钮替换为与Panel一致的button按钮样式

This commit is contained in:
zqm
2025-11-05 14:53:57 +08:00
parent 96841ec19d
commit de1eb7f9b9

View File

@@ -9,10 +9,16 @@
@click="setActiveTab(index)" @click="setActiveTab(index)"
> >
{{ panel.title }} {{ panel.title }}
<span <button
class="tab-close" class="button-icon p-[2px] rounded hover:opacity-100 opacity-80"
@click.stop="closeTab(panel.id)" @click.stop="closeTab(panel.id)"
>×</span> aria-label="关闭"
>
<svg width="11" height="11" viewBox="0 0 11 11" aria-hidden="true">
<line x1="2" y1="2" x2="9" y2="9" stroke="#e6efff" stroke-width="1" />
<line x1="2" y1="9" x2="9" y2="2" stroke="#e6efff" stroke-width="1" />
</svg>
</button>
</div> </div>
<div class="tab-placeholder"></div> <div class="tab-placeholder"></div>
</div> </div>
@@ -127,18 +133,33 @@ const closeTab = (tabId) => {
color: #333; color: #333;
} }
.tab-close { .button-icon {
margin-left: 8px; margin-left: 8px;
font-size: 14px; background: transparent;
color: #333; border: none;
cursor: pointer; cursor: pointer;
padding: 0 4px; display: flex;
border-radius: 2px; align-items: center;
justify-content: center;
} }
.tab-close:hover { /* 确保在活动标签页中的按钮样式正确 */
background: #ff6b6b; .tab-item.active .button-icon {
color: white; opacity: 0.6;
}
.tab-item.active .button-icon:hover {
opacity: 1;
background: #f3f4f6;
}
/* 确保在非活动标签页中的按钮样式正确 */
.tab-item:not(.active) .button-icon svg line {
stroke: #e6efff;
}
.tab-item:not(.active) .button-icon:hover svg line {
stroke: white;
} }
.tab-placeholder { .tab-placeholder {