perf: add mark color in tab
This commit is contained in:
parent
bb537a7175
commit
bc499643db
|
@ -12,10 +12,6 @@ const i18n = useI18n()
|
||||||
const tabStore = useTabStore()
|
const tabStore = useTabStore()
|
||||||
const connectionStore = useConnectionStore()
|
const connectionStore = useConnectionStore()
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
backgroundColor: String,
|
|
||||||
})
|
|
||||||
|
|
||||||
const onCloseTab = (tabIndex) => {
|
const onCloseTab = (tabIndex) => {
|
||||||
$dialog.warning(i18n.t('close_confirm'), () => {
|
$dialog.warning(i18n.t('close_confirm'), () => {
|
||||||
const tab = get(tabStore.tabs, tabIndex)
|
const tab = get(tabStore.tabs, tabIndex)
|
||||||
|
@ -25,14 +21,18 @@ const onCloseTab = (tabIndex) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const activeTabStyle = computed(() => ({
|
const activeTabStyle = computed(() => {
|
||||||
|
const { name } = tabStore.currentTab
|
||||||
|
const { markColor = '' } = connectionStore.serverProfile[name] || {}
|
||||||
|
return {
|
||||||
backgroundColor: themeVars.value.baseColor,
|
backgroundColor: themeVars.value.baseColor,
|
||||||
borderTopWidth: '1px',
|
borderTopWidth: markColor ? '3px' : '1px',
|
||||||
borderTopColor: themeVars.value.borderColor,
|
borderTopColor: markColor || themeVars.value.borderColor,
|
||||||
borderBottomColor: themeVars.value.baseColor,
|
borderBottomColor: themeVars.value.baseColor,
|
||||||
borderTopLeftRadius: themeVars.value.borderRadius,
|
borderTopLeftRadius: themeVars.value.borderRadius,
|
||||||
borderTopRightRadius: themeVars.value.borderRadius,
|
borderTopRightRadius: themeVars.value.borderRadius,
|
||||||
}))
|
}
|
||||||
|
})
|
||||||
const inactiveTabStyle = computed(() => ({
|
const inactiveTabStyle = computed(() => ({
|
||||||
borderWidth: '0 0 1px',
|
borderWidth: '0 0 1px',
|
||||||
borderBottomColor: themeVars.value.borderColor,
|
borderBottomColor: themeVars.value.borderColor,
|
||||||
|
|
Loading…
Reference in New Issue