@xilonglab/vue-main 1.6.2 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
defineOptions({ name: "XlTabsNav" })
|
|
3
3
|
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
/** 当前激活 tab 的背景色,默认淡绿色 */
|
|
6
|
+
activeBgColor: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: 'rgb(66, 185, 131)'
|
|
9
|
+
}
|
|
10
|
+
})
|
|
4
11
|
|
|
5
12
|
import { useRouter } from 'vue-router'
|
|
6
13
|
import { inject } from 'vue'
|
|
@@ -78,6 +85,7 @@ const showContextMenu = (event, tab) => {
|
|
|
78
85
|
:key="tab.path"
|
|
79
86
|
class="tab-item"
|
|
80
87
|
:class="{ active: tab.fullPath === store.state.activeTab }"
|
|
88
|
+
:style="tab.fullPath === store.state.activeTab ? { background: props.activeBgColor } : undefined"
|
|
81
89
|
@click="switchTab(tab)"
|
|
82
90
|
@contextmenu="showContextMenu($event, tab)"
|
|
83
91
|
>
|
|
@@ -112,7 +120,7 @@ const showContextMenu = (event, tab) => {
|
|
|
112
120
|
}
|
|
113
121
|
|
|
114
122
|
.tab-item.active {
|
|
115
|
-
background
|
|
123
|
+
/* background 由 props.activeBgColor 通过内联 style 控制,默认淡绿色 */
|
|
116
124
|
color:#fff;
|
|
117
125
|
}
|
|
118
126
|
|