将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)"
>
{{ panel.title }}
<span
class="tab-close"
<button
class="button-icon p-[2px] rounded hover:opacity-100 opacity-80"
@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 class="tab-placeholder"></div>
</div>
@@ -127,18 +133,33 @@ const closeTab = (tabId) => {
color: #333;
}
.tab-close {
.button-icon {
margin-left: 8px;
font-size: 14px;
color: #333;
background: transparent;
border: none;
cursor: pointer;
padding: 0 4px;
border-radius: 2px;
display: flex;
align-items: center;
justify-content: center;
}
.tab-close:hover {
background: #ff6b6b;
color: white;
/* 确保在活动标签页中的按钮样式正确 */
.tab-item.active .button-icon {
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 {